Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- worker_processes 3;
- error_log logs/error.log;
- error_log logs/error.log notice;
- error_log logs/error.log info;
- #pid logs/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- sendfile on;
- keepalive_timeout 65;
- #gzip on;
- server {
- listen 80;
- server_name "";
- return 444;
- }
- server {
- listen 80;
- server_name DOMAIN1.COM WWW.DOMAIN1.COM;
- root /usr/local/nginx/html;
- index index.html index.htm;
- access_log logs/www.access.log;
- location / {
- try_files $uri $uri/ =404;
- }
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
- # HTTPS server
- server {
- listen 443 ssl;
- server_name SUB.DOMAIN1.COM;
- ssl_certificate /etc/letsencrypt/live/SUB.DOMAIN1.COM/cert.pem;
- ssl_certificate_key /etc/letsencrypt/live/SUB.DOMAIN1.COM/privkey.pem;
- ssl_trusted_certificate /etc/letsencrypt/live/SUB.DOMAIN1.COM/chain.pem;
- include ssl-params.conf;
- root /usr/local/nginx/html;
- index index.html index.htm;
- location / {
- try_files $uri $uri/ =404;
- }
- }
- server {
- listen 443 ssl http2 default_server;
- server_name DOMAIN2.TLD;
- ssl on;
- ssl_certificate /usr/local/nginx/DOMAIN2.TLD.pem;
- ssl_certificate_key /usr/local/nginx/DOMAIN2.TLD-priv.key;
- ssl_trusted_certificate /usr/local/nginx/DOMAIN2.TLD-chain.pem;
- include ssl-params.conf;
- location /static/ {
- alias /var/www/DOMAIN2.TLD/static/;
- }
- location / {
- # root html;
- # index index.html index.htm;
- proxy_pass_header Server;
- proxy_set_header Host $http_host;
- proxy_redirect off;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Scheme $scheme;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-proto http;
- proxy_connect_timeout 10;
- proxy_read_timeout 10;
- proxy_pass http://localhost:8000/;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement