Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.54 KB | None | 0 0
  1. upstream tt-cup-com_django_proxy {
  2.     # As TCP/IP:
  3.     # http://nginx.org/ru/docs/http/ngx_http_upstream_module.html#upstream
  4.     server 0.0.0.0:50010 max_fails=4 fail_timeout=16s;
  5. }
  6.  
  7. server {
  8.     # Redirection of http(s)://www.core2.tt-cup.com on http(s)://core2.tt-cup.com
  9.     # i.e. without `www` as 301 redirect.
  10.     listen 81;
  11.     server_name www.core2.tt-cup.com;
  12.     return 301 http://core2.tt-cup.com$request_uri;
  13. }
  14.  
  15. server {
  16.     listen 80;
  17.     keepalive_timeout 60s;
  18.     client_max_body_size 0;
  19.     server_name core2.tt-cup.com *.core2.tt-cup.com;
  20.  
  21.     proxy_connect_timeout 50s;
  22.     proxy_send_timeout 64;
  23.     proxy_read_timeout 64;
  24.     send_timeout 32;
  25.  
  26.     location ~ ^/(media|static)/  {
  27.         # Buffering the static data for 7 minutes.
  28.         expires 7m;
  29.         root "/home/django/workspace/apps/runtime/tt-cup-com/tt-cup-com-app/djapy/var/www";
  30.         error_log "/home/django/workspace/apps/runtime/tt-cup-com/tt-cup-com-app/djapy/var/log/nginx_error.log" warn;
  31.         access_log "/home/django/workspace/apps/runtime/tt-cup-com/tt-cup-com-app/djapy/var/log/nginx_access.log";
  32.     }
  33.  
  34.     location / {
  35.         # Checks for static file, if not found proxy to app.
  36.         try_files $uri @django_app_proxy;
  37.     }
  38.  
  39.     location @django_app_proxy {
  40.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  41.         proxy_set_header Host $http_host;
  42.         proxy_buffering off;
  43.         proxy_redirect off;
  44.  
  45.         proxy_read_timeout 300;
  46.         proxy_pass http://tt-cup-com_django_proxy;
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement