Last active
December 21, 2015 23:19
-
-
Save ErDmKo/6381208 to your computer and use it in GitHub Desktop.
nginx server conf and uwsgi for django project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name www.<domain>; | |
return 301 $scheme://<domain>$request_uri; | |
} | |
server { | |
listen 80; | |
server_name localhost <ip> <domain>; | |
location ~* ^.+\.(xml|html|txt|png|jpg|gif|ico)$ { | |
root /home/<pr_name>/static; | |
} | |
location ~ ^/index.(html|php)$ { | |
if ($request_uri ~ ^/index.(html|php)) { | |
rewrite ^.*$ / permanent; | |
} | |
access_log /var/log/nginx/<pr_name>.access.log main; | |
error_log /var/log/nginx/<pr_name>.err.log; | |
location / { | |
uwsgi_pass unix:///tmp/uwsgi_<pr_name>; | |
include uwsgi_params; | |
} | |
location /static { | |
root /home/<pr_name>/static; | |
} | |
location /media { | |
root /home/<pr_name>/static; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/bin/uwsgi \ | |
--chdir /home/<pr_name>/<pr_name>/<pr_name>/ \ | |
--socket /tmp/uwsgi_<pr_name> \ | |
--chmod-socket \ | |
--module wsgi \ | |
--pythonpath /home/<pr_name>/<pr_name>/ \ | |
--touch-reload /home/<pr_name>/reload \ | |
--daemonize /var/log/uwsgi/<pr_name>.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment