Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.80 KB | None | 0 0
  1. worker_processes  1;
  2. events {
  3.     worker_connections  1024;
  4. }
  5.  
  6. http {
  7.     default_type  application/octet-stream;
  8.     include  mime.types;
  9.     sendfile  on;
  10.     keepalive_timeout  30;
  11.  
  12.     # This section is needed to proxy web-socket connections
  13.     map $http_upgrade $connection_upgrade {
  14.         default upgrade;
  15.         ''      close;
  16.     }
  17.  
  18.     upstream socket {
  19.         least_conn;
  20.         server 127.0.0.1:4100;
  21.         #server 127.0.0.1:4200;
  22.         #server 127.0.0.1:4300;
  23.     }
  24.  
  25.     server {
  26.         listen 4000;
  27.         root C:/Users/Maxime/Documents/Dev/Qwirk;
  28.         server_name localhost;
  29.  
  30.         location / {
  31.             proxy_set_header X-Real-IP $remote_addr;
  32.             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  33.             proxy_set_header Host $http_host;
  34.             proxy_set_header X-NginX-Proxy true;
  35.  
  36.             # prevents 502 bad gateway error
  37.             proxy_buffers 8 32k;
  38.             proxy_buffer_size 64k;
  39.  
  40.             proxy_pass http://socket;
  41.             proxy_redirect off;
  42.  
  43.             # enables WS support
  44.             proxy_http_version 1.1;
  45.             proxy_set_header Upgrade $http_upgrade;
  46.             proxy_set_header Connection $connection_upgrade;
  47.         }
  48.     }
  49.  
  50.     server {
  51.         listen 4500;
  52.         root C:/Users/Maxime/Documents/Dev/Qwirk;
  53.         server_name localhost;
  54.  
  55.         location / {
  56.             index views/index.html;
  57.         }
  58.  
  59.         location /static/ {
  60.             try_files $uri /static;
  61.         }
  62.  
  63.         location ~ \.css {
  64.             add_header Content-Type text/css;
  65.         }
  66.  
  67.         location ~ \.js {
  68.             add_header Content-Type application/x-javascript;
  69.         }
  70.  
  71.         location ~ \.tags {
  72.             add_header Content-Type riot/tag;
  73.         }
  74.     }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement