Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Add two configuration files in /etc/nginx/sites-available; one for production (ocrui-prod), and one for development (ocrui-dev).

Create a symlink to them from /etc/nginx/sites-enabled to actually enable those virtual hosts.

The configuration is mostly the same; the only differences are the server name, log file names, and a limit on the IPs allowed to connect. Differences marked in bold (but double-check).

First, the production config:



# -wvh- OCRUI PRODUCTION application server

server {
        #listen   80; ## listen for ipv4; this line is default and implied
        #listen   [::]:80 default_server ipv6only=on; ## listen for ipv6
        listen 80 default_server;

        # -wvh- server name HTTP/1.1
        server_name ocrui.lib.helsinki.fi ocrui-kk.lib.helsinki.fi ocrui ocrui-kk localhost;

        # -wvh- limit for POST
        client_max_body_size 12M;

        # -wvh- docroot
        root /data/web/ocrui/backend;
        index index.html;

        location / {
                proxy_pass http://localhost:5000;
                include /etc/nginx/proxy_params;
        }

        #location / {
        #       try_files $uri $uri/ /index.html;
        #}

        location /editor/ {
        #location ^~ /editor/ {
                alias /data/web/ocrui/frontend/;
                include static_expires;
        }

       location /data/ {
                alias /data/web/ocrui/backend/instance/data/;
               include static_expires;
       }

        # logs
        access_log /var/log/nginx/ocrui-access.log;
        error_log /var/log/nginx/ocrui-error.log;

        # -wvh- handle favicon, robots
        location = /favicon.ico { access_log off; log_not_found off; }
        location = /robots.txt { allow all; access_log off; log_not_found off; }
        # -wvh- handle dot-files (uncomment one of the following)
        #location ~ /\. { deny all; }
        location ~ /\.(?:git|hg|ht) { deny all; }

        # expires and access/error logging (expires: @/time/max; time ms/s/m/h/d/w/M/y)
        #include static_expires;


        ### -wvh- default config remnants below, ignore

        #error_page 404 /404.html;

        # redirect server error pages to the static page /50x.html
        #
        #error_page 500 502 503 504 /50x.html;
        #location = /50x.html {
        #       root /usr/share/nginx/www;
        #}

}




Here is the development config (ocrui-dev).

...