[dancer-users] Dancer NGINX configutation

Richard Reina gatorreina at gmail.com
Tue Mar 8 13:45:48 GMT 2016


I have the following nginx configuration that I believe -- or at least hope
-- serves up my static files, like images ad videos, directly without
invoking my dancer app. Can anyone tells me if this is the case or not, or
how I can test to see if they are indeed being served directly by NGINX?

server {
    listen 80;
    server_name mydomain.com;
    rewrite ^/(.*) https://mydomain.com/$1 permanent;
        }

server {
    listen 443 ssl;
    server_name mydomain.com;
    ssl_certificate /home/starman/mydomain.com.chained.crt;
    ssl_certificate_key /home/starman/mydomain.com.key;
    client_max_body_size 20M;

    location / {

    # Serve static files directly:
         if (-f $request_filename) {
               expires 30d;
               break;
            }

    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:5000;
        }

       }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160308/96b51177/attachment.html>


More information about the dancer-users mailing list