Advertisement
Guest User

NGINXconfig-issues

a guest
Apr 11th, 2017
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.34 KB | None | 0 0
  1. worker_processes  3;
  2.  
  3. error_log  logs/error.log;
  4. error_log  logs/error.log  notice;
  5. error_log  logs/error.log  info;
  6.  
  7. #pid        logs/nginx.pid;
  8.  
  9.  
  10. events {
  11.     worker_connections  1024;
  12. }
  13.  
  14. http {
  15.     include       mime.types;
  16.     default_type  application/octet-stream;
  17.     sendfile        on;
  18.     keepalive_timeout  65;
  19.  
  20.     #gzip  on;
  21.     server {
  22.            listen 80;
  23.        server_name "";
  24.        return 444;
  25.        }
  26.     server {
  27.         listen       80;
  28.         server_name  DOMAIN1.COM WWW.DOMAIN1.COM;
  29.         root /usr/local/nginx/html;
  30.         index  index.html index.htm;
  31.  
  32.         access_log  logs/www.access.log;
  33.  
  34.        location / {
  35.             try_files $uri $uri/ =404;
  36.        }
  37.  
  38.         # redirect server error pages to the static page /50x.html
  39.         #
  40.         error_page   500 502 503 504  /50x.html;
  41.         location = /50x.html {
  42.             root   html;
  43.         }
  44.     }
  45.  
  46.  
  47. #    HTTPS server
  48.  
  49.     server {
  50.        listen       443 ssl;
  51.        server_name  SUB.DOMAIN1.COM;
  52.  
  53.        ssl_certificate      /etc/letsencrypt/live/SUB.DOMAIN1.COM/cert.pem;
  54.        ssl_certificate_key  /etc/letsencrypt/live/SUB.DOMAIN1.COM/privkey.pem;
  55.        ssl_trusted_certificate /etc/letsencrypt/live/SUB.DOMAIN1.COM/chain.pem;
  56.  
  57.        include ssl-params.conf;
  58.            root   /usr/local/nginx/html;
  59.            index  index.html index.htm;
  60.  
  61.        location / {
  62.             try_files $uri $uri/ =404;
  63.        }
  64.     }
  65.  
  66.     server {
  67.        listen 443 ssl http2 default_server;
  68.        server_name DOMAIN2.TLD;
  69.  
  70.        ssl on;
  71.        ssl_certificate /usr/local/nginx/DOMAIN2.TLD.pem;
  72.        ssl_certificate_key /usr/local/nginx/DOMAIN2.TLD-priv.key;
  73.        ssl_trusted_certificate /usr/local/nginx/DOMAIN2.TLD-chain.pem;
  74.        include ssl-params.conf;
  75.  
  76.        location /static/ {
  77.             alias /var/www/DOMAIN2.TLD/static/;
  78.         }
  79.  
  80.  
  81.        location / {
  82. #           root   html;
  83. #           index  index.html index.htm;
  84.         proxy_pass_header Server;
  85.         proxy_set_header Host $http_host;
  86.         proxy_redirect off;
  87.         proxy_set_header X-Real-IP $remote_addr;
  88.         proxy_set_header X-Scheme $scheme;
  89.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  90.         proxy_set_header X-Forwarded-proto http;
  91.         proxy_connect_timeout 10;
  92.         proxy_read_timeout 10;
  93.         proxy_pass http://localhost:8000/;
  94.        }
  95.     }
  96.  
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement