Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- upstream node {
- ip_hash;
- server paqt.chat:4000;
- }
- server {
- listen 443 ssl;
- server_name paqt.chat;
- root /var/www/html/frontend_build;
- access_log /var/log/nginx/frontend-access.log;
- error_log /var/log/nginx/frontend-error.log;
- index index.html;
- ssl_certificate /etc/letsencrypt/live/paqt.chat/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/paqt.chat/privkey.pem;
- include /etc/letsencrypt/options-ssl-nginx.conf;
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
- location / {
- try_files $uri /index.html =404;
- }
- location /static {
- try_files $uri =404;
- }
- location /node {
- proxy_pass http://node;
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection 'upgrade';
- proxy_set_header Host $host;
- proxy_cache_bypass $http_upgrade;
- }
- }
- server {
- listen 8081 ssl;
- server_name paqt.chat;
- root /var/www/html/public;
- index index.php index.html index.htm;
- access_log /var/log/nginx/access.log;
- error_log /var/log/nginx/error.log;
- ssl_certificate /etc/letsencrypt/live/paqt.chat/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/paqt.chat/privkey.pem;
- include /etc/letsencrypt/options-ssl-nginx.conf;
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
- location / {
- try_files $uri $uri/ /index.php?$args;
- }
- location ~ \.php$ {
- if ($request_method = 'OPTIONS') {
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization';
- add_header 'Access-Control-Max-Age' 1728000;
- add_header 'Content-Type' 'text/plain; charset=utf-8';
- add_header 'Content-Length' 0;
- return 204;
- }
- if ($request_method ~ 'POST|GET|PUT|DELETE') {
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
- add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
- add_header 'Access-Control-Expose-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,Authorization';
- }
- try_files $uri =404;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_pass phpfpm:9000;
- fastcgi_index index.php;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param PATH_INFO $fastcgi_path_info;
- }
- }
- server {
- listen 80;
- server_name paqt.chat;
- root /var/www/html/frontend_build;
- access_log /var/log/nginx/frontend-access.log;
- error_log /var/log/nginx/frontend-error.log;
- index index.html;
- location /.well-known/acme-challenge/ {
- root /var/www/certbot;
- }
- location / {
- return 301
- https://$host$request_uri;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement