Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- upstream backend {
- server speechyard.com:443;
- server 127.0.0.1:8000 backup;
- }
- upstream backend_chat {
- server speechyard.com:8085;
- server 127.0.0.1:8000 backup;
- }
- server {
- listen 80 default_server;
- listen [::]:80 default_server ipv6only=on;
- root /var/www/public_html/dummy;
- index index.html index.htm;
- # Make site accessible from http://localhost/
- server_name localhost;
- location / {
- # First attempt to serve request as file, then
- # as directory, then fall back to displaying a 404.
- try_files $uri $uri/ /index.html;
- # Uncomment to enable naxsi on this location
- # include /etc/nginx/naxsi.rules
- }
- }
- server {
- listen 0.0.0.0:80;
- root /var/www/public_html/dummy;
- index index.html index.htm;
- server_name speechyard.com;
- #SSL
- listen 0.0.0.0:443;
- ssl on;
- ssl_certificate /etc/nginx/ssl/public.crt;
- ssl_certificate_key /etc/nginx/ssl/private.key;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- access_log /var/log/nginx/dummy.access.log;
- error_log /var/log/nginx/dummy.error.log;
- location / {
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $host;
- proxy_set_header X-NginX-Proxy true;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_set_header HTTPS $https;
- proxy_pass https://backend;
- proxy_http_version 1.1;
- proxy_read_timeout 150;
- # First attempt to serve request as file, then
- # as directory, then fall back to displaying a 404.
- #try_files $uri $uri/ /index.html;
- # Uncomment to enable naxsi on this location
- # include /etc/nginx/naxsi.rule
- }
- if ($request_method = "GET" ) {
- rewrite ^([^.\?]*[^/])$ $1/ permanent;
- }
- }
- server {
- listen 0.0.0.0:80;
- root /var/www/public_html/dummy;
- index index.html index.htm;
- server_name admin.speechyard.com;
- location / {
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $host;
- proxy_set_header X-NginX-Proxy true;
- proxy_pass http://backend;
- #proxy_redirect off;
- proxy_http_version 1.1;
- proxy_read_timeout 150;
- # First attempt to serve request as file, then
- # as directory, then fall back to displaying a 404.
- #try_files $uri $uri/ /index.html;
- # Uncomment to enable naxsi on this location
- # include /etc/nginx/naxsi.rules
- }
- }
- server {
- listen 8085;
- listen [::]:8085 ipv6only=on;
- root /var/www/public_html/dummy;
- index index.html index.htm;
- server_name speechyard.com;
- #SSL
- ssl_stapling on;
- ssl on;
- ssl_certificate /etc/nginx/ssl/public.crt;
- ssl_certificate_key /etc/nginx/ssl/private.key;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- access_log /var/log/nginx/chat.access.log;
- error_log /var/log/nginx/chat.error.log;
- location / {
- proxy_set_header X-Real-IP $remote_addr;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection "upgrade";
- # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header Host $host;
- # proxy_set_header X-NginX-Proxy true;
- proxy_pass https://backend_chat;
- #proxy_redirect off;
- proxy_read_timeout 150;
- }
- }
- # another virtual host using mix of IP-, name-, and port-based configuration
- #
- server {
- listen 8000;
- ssl on;
- ssl_certificate /etc/nginx/ssl/public.crt;
- ssl_certificate_key /etc/nginx/ssl/private.key;
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
- root /var/www/public_html/dummy;
- index index.html index.htm;
- location / {
- try_files $uri $uri/ /index.html;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement