jasonbin

Untitled

Oct 18th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.70 KB | None | 0 0
  1. server {
  2.         listen   80;
  3.         server_name fbsample.linuxserv.space;
  4.         root /var/www/fbsample;
  5.         return 301 https://$host$request_uri;
  6. }
  7. server {
  8.     listen 443 ssl;
  9.     server_name fbsample.linuxserv.space;
  10.     root /var/www/fbsample;
  11.  
  12.     ssl_certificate /etc/letsencrypt/live/fbsample.linuxserv.space/fullchain.pem;
  13.     ssl_certificate_key /etc/letsencrypt/live/fbsample.linuxserv.space/privkey.pem;
  14.  
  15.     access_log /var/log/nginx/fbsample.access.log;
  16.     error_log /var/log/nginx/fbsample.error.log;
  17.  
  18.     location /live {
  19.         proxy_pass http://127.0.0.1:3000;
  20.         proxy_http_version 1.1;
  21.         proxy_set_header Upgrade $http_upgrade;
  22.         proxy_set_header Connection 'upgrade';
  23.         proxy_set_header Host $host;
  24.         proxy_cache_bypass $http_upgrade;
  25.     }
  26.  
  27.     location /socket.io {
  28.         proxy_pass http://127.0.0.1:3000;
  29.         proxy_redirect off;
  30.         proxy_buffering off;
  31.  
  32.         proxy_set_header Host $host;
  33.         proxy_set_header X-Real-IP $remote_addr;
  34.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  35.  
  36.         proxy_http_version 1.1;
  37.         proxy_set_header Upgrade $http_upgrade;
  38.         proxy_set_header Connection "Upgrade";
  39.     }
  40.  
  41.  
  42.     location /static {
  43.         root /var/www/fbsample/live/public;
  44.     }
  45.  
  46.     location / {
  47.         index index.php;
  48.         try_files $uri $uri/ /index.php?$query_string;
  49.     }
  50.  
  51.     location ~ \.php$ {
  52.         fastcgi_pass   127.0.0.1:9000;
  53.         fastcgi_index  index.html;
  54.         fastcgi_param  SCRIPT_FILENAME /var/www/fbsample$fastcgi_script_name;
  55.         include        /etc/nginx/fastcgi_params;
  56.     }
  57.  
  58.     location ~ /\.ht {
  59.         deny all;
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment