Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- upstream tt-cup-com_django_proxy {
- # As TCP/IP:
- # http://nginx.org/ru/docs/http/ngx_http_upstream_module.html#upstream
- server 0.0.0.0:50010 max_fails=4 fail_timeout=16s;
- }
- server {
- # Redirection of http(s)://www.core2.tt-cup.com on http(s)://core2.tt-cup.com
- # i.e. without `www` as 301 redirect.
- listen 81;
- server_name www.core2.tt-cup.com;
- return 301 http://core2.tt-cup.com$request_uri;
- }
- server {
- listen 80;
- keepalive_timeout 60s;
- client_max_body_size 0;
- server_name core2.tt-cup.com *.core2.tt-cup.com;
- proxy_connect_timeout 50s;
- proxy_send_timeout 64;
- proxy_read_timeout 64;
- send_timeout 32;
- location ~ ^/(media|static)/ {
- # Buffering the static data for 7 minutes.
- expires 7m;
- root "/home/django/workspace/apps/runtime/tt-cup-com/tt-cup-com-app/djapy/var/www";
- error_log "/home/django/workspace/apps/runtime/tt-cup-com/tt-cup-com-app/djapy/var/log/nginx_error.log" warn;
- access_log "/home/django/workspace/apps/runtime/tt-cup-com/tt-cup-com-app/djapy/var/log/nginx_access.log";
- }
- location / {
- # Checks for static file, if not found proxy to app.
- try_files $uri @django_app_proxy;
- }
- location @django_app_proxy {
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $http_host;
- proxy_buffering off;
- proxy_redirect off;
- proxy_read_timeout 300;
- proxy_pass http://tt-cup-com_django_proxy;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement