wakari_https.conf (AEN 4.0)
===========================

.. raw:: html

    <div class="highlight-default"><div class="highlight"><pre><span></span>server {
        listen      80 default_server;
        server_name _;
        rewrite     ^   https://$host$request_uri? permanent;
    }

    server {
        listen              443 ssl default_server;
        gzip                on;
        gzip_http_version   1.1;
        gzip_vary           on;
        gzip_comp_level     6;
        gzip_proxied        any;
        gzip_types          text/plain
                            text/css
                            application/json
                            application/x-javascript
                            text/xml
                            application/xml
                            application/xml+rss
                            text/javascript
                            application/javascript
                            text/x-js;
        gzip_buffers        16 8k;
        server_name         _;
        ssl_certificate     server.crt;
        ssl_certificate_key server.key;

        # Uncomment this header when the Gateway is on a different box
        # than the Server or both are using SSL.  If this header is
        # used when SSL is enabled in the Server but on the Gateway
        # on the same box then apps will not launch.
        #add_header Strict-Transport-Security max-age=31536000;

        #charset koi8-r;

        access_log  /var/log/nginx/woc.log;
        error_log   /var/log/nginx/woc-error.log;

        location / {
            proxy_pass          http://127.0.0.1:5000;
            proxy_set_header    Host            $host:$server_port;
            proxy_set_header    X-Real-IP       $remote_addr;
            proxy_set_header    x-Forwarded-For $proxy_add_x_forwarded_for;
        }

        # /usr/share/nginx/html/www_maintenance/502.html
        error_page 502 503 504 @www_maintenance;
        location @www_maintenance {
            # todo: change url
            root /usr/share/nginx/html;
            rewrite ^(.*)$ /www_maintenance/502.html break;
        }

        location /static {
            alias /opt/wakari/static;
        }
    }
    </pre></div>
    </div>
