Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #file: /var/nginx/sites-available/wsgi-test
- #link: /var/nginx/sites-enabled/wsgi-test
- server {
- listen 80;
- # access by name
- server_name wsgi; # on localhost I use shortname `wsgi` so I have in /etc/hosts: "127.0.0.1 wsgi"
- server_name subdomain.example.com;
- # static files
- root /var/www/wsgi-test;
- index index.html index.htm;
- # logs
- access_log /var/log/nginx/wsgi-access.log;
- error_log /var/log/nginx/wsgi-error.log;
- # first try static files, later use Gunicorn
- location / {
- try_files $uri $uri/ @gunicorn;
- }
- # connection to Gunicorn on localhost on port 3001
- location @gunicorn {
- proxy_pass http://127.0.0.1:3001;
- include proxy_params;
- }
- }
- #file: /etc/nginx/proxy_params
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement