Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 2.17 KB | None | 0 0
  1. worker_processes 1;
  2.  
  3. user nobody nogroup;
  4. # 'user nobody nobody;' for systems with 'nobody' as a group instead
  5. pid /var/run/nginx.pid;
  6. error_log /home/hrtec/log/nginx.error.log;
  7.  
  8. events {
  9.   worker_connections 1024; # increase if you have lots of clients
  10.   accept_mutex off; # set to 'on' if nginx worker_processes > 1
  11.   # 'use epoll;' to enable for Linux 2.6+
  12.   # 'use kqueue;' to enable for FreeBSD, OSX
  13. }
  14.  
  15. http {
  16.   include /etc/nginx/mime.types;
  17.   # fallback in case we can't determine a type
  18.  default_type application/octet-stream;
  19.  access_log /home/hrtec/log/nginx.access.log combined;
  20.  sendfile on;
  21.  
  22.  upstream app_server {
  23.    # fail_timeout=0 means we always retry an upstream even if it failed
  24.    # to return a good HTTP response
  25.  
  26.    # for UNIX domain socket setups
  27.    # server unix:/tmp/gunicorn.sock fail_timeout=0;
  28.  
  29.    # for a TCP configuration
  30.    server 127.0.0.1:8000 fail_timeout=0;
  31.  }
  32.  
  33.  server {
  34.    # if no Host match, close the connection to prevent host spoofing
  35.    listen 80 default_server;
  36.    return 444;
  37.  }
  38.  
  39.  server {
  40.    # use 'listen 80 deferred;' for Linux
  41.    # use 'listen 80 accept_filter=httpready;' for FreeBSD
  42.    listen 80;
  43.    client_max_body_size 4G;
  44.  
  45.    # set the correct host(s) for your site
  46.    server_name 192.168.0.11;
  47.  
  48.    keepalive_timeout 5;
  49.  
  50.    # path for static files
  51.    root /home/hrtec/hrtec/static_root;
  52.  
  53.    location / {
  54.      # checks for static file, if not found proxy to app
  55.      try_files $uri @proxy_to_app;
  56.    }
  57.  
  58.    location /static {
  59.      # path for Django static files
  60.      alias /home/hrtec/hrtec/static_root;
  61.    }
  62.  
  63.    location @proxy_to_app {
  64.      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  65.      # enable this if and only if you use HTTPS
  66.      # proxy_set_header X-Forwarded-Proto https;
  67.      proxy_set_header Host $http_host;
  68.      # we don't want nginx trying to do something clever with
  69.       # redirects, we set the Host: header above already.
  70.       proxy_redirect off;
  71.       proxy_pass http://app_server;
  72.     }
  73.  
  74.     error_page 500 502 503 504 /500.html;
  75.     location = /500.html {
  76.       root /home/hrtec/hrtec/static_root;
  77.     }
  78.   }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement