Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample configuration file for Nginx #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions docs/chapters/deploying.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,52 @@ For another setup that offers more performance and scalability refer to the

sudo apt-get remove --purge libjpeg-dev libpq-dev libpng-dev libtiff-dev zlib1g-dev

#. Sample configuration file for Nginx

::

server {
listen 80;

location ~ \.(cgi|fcgi|rb)$ { deny all; }
location ~ /\.ht { deny all; }

location /media {
alias /opt/mayan-edms/media;
}

location /static {
alias /opt/mayan-edms/media/static;
# Make Browsers Cache Static Files On nginx
# See: http://www.howtoforge.com/make-browsers-cache-static-files-on-nginx
# and http://serverfault.com/questions/370525/nginxdjango-serving-static-files
access_log off;
expires modified 1m;
}

location /favicon.ico {
alias /opt/mayan-edms/media/static/appearance/images/favicon.ico;
}

location / {
proxy_connect_timeout 300s;
proxy_read_timeout 300s;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host:$server_port;
client_max_body_size 10m;
#proxy_pass http://unix://home/mayan/run/gunicorn.sock;
proxy_pass http://127.0.0.1:8000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
}

#access_log /home/mayan/logs/access.log;
#error_log /home/mayan/logs/error.log;
}


.. _deployment_advanced:

Expand Down