a_igin

nginx

Jun 10th, 2020
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.70 KB | None | 0 0
  1. upstream web {
  2.     ip_hash;
  3.     server web:8000;
  4.  
  5. }
  6.  
  7. server {
  8.     listen 8000;
  9.     server_name RECOURCE_NAME;
  10.     proxy_read_timeout 60;
  11.  
  12.     client_max_body_size 20m;
  13.  
  14.     location / {
  15.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  16.         proxy_set_header Host $host;
  17.         proxy_redirect off;
  18.  
  19.         proxy_pass http://web/;
  20.     }
  21.  
  22.     location /static/ {
  23.         access_log /root/log/nginx-static-access.log;
  24.         error_log /root/log/nginx-static-error.log;
  25.         alias /static/;
  26.     }
  27.  
  28.     location /media/ {
  29.         access_log /root/log/nginx-media-access.log;
  30.         error_log /root/log/nginx-media-error.log;
  31.         alias /media/;
  32.     }
  33.  
  34. }
Add Comment
Please, Sign In to add comment