wakari_https.conf (AEN 4.1.3)
=============================

.. raw:: html

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

    server <span class="o">{</span>
        listen              <span class="m">443</span> ssl default_server<span class="p">;</span>
        gzip                on<span class="p">;</span>
        gzip_http_version   <span class="m">1</span>.1<span class="p">;</span>
        gzip_vary           on<span class="p">;</span>
        gzip_comp_level     <span class="m">6</span><span class="p">;</span>
        gzip_proxied        any<span class="p">;</span>
        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<span class="p">;</span>
        gzip_buffers        <span class="m">16</span> 8k<span class="p">;</span>
        server_name         _<span class="p">;</span>
        ssl_certificate     server.crt<span class="p">;</span>
        ssl_certificate_key server.key<span class="p">;</span>

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

        <span class="c1">#charset koi8-r;</span>

        access_log  /var/log/nginx/woc.log<span class="p">;</span>
        error_log   /var/log/nginx/woc-error.log<span class="p">;</span>

        location / <span class="o">{</span>
            proxy_pass          http://127.0.0.1:5000<span class="p">;</span>
            proxy_set_header    Host            <span class="nv">$host</span>:<span class="nv">$server_port</span><span class="p">;</span>
            proxy_set_header    X-Real-IP       <span class="nv">$remote_addr</span><span class="p">;</span>
            proxy_set_header    x-Forwarded-For <span class="nv">$proxy_add_x_forwarded_for</span><span class="p">;</span>
        <span class="o">}</span>

        <span class="c1"># /usr/share/nginx/html/www_maintenance/502.html</span>
        error_page <span class="m">502</span> <span class="m">503</span> <span class="m">504</span> @www_maintenance<span class="p">;</span>
        location @www_maintenance <span class="o">{</span>
            <span class="c1"># todo: change url</span>
            root /usr/share/nginx/html<span class="p">;</span>
            rewrite ^<span class="o">(</span>.*<span class="o">)</span>$ /www_maintenance/502.html break<span class="p">;</span>
        <span class="o">}</span>

        location /static <span class="o">{</span>
            <span class="nb">alias</span> /opt/wakari/static<span class="p">;</span>
        <span class="o">}</span>
    <span class="o">}</span>
    </pre></div>
    </div>
