Advertisement
Sumitss

Untitled

Apr 26th, 2021
2,742
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. user root;
  2. worker_processes auto;
  3. error_log /var/log/nginx/error.log;
  4. pid /run/nginx.pid;
  5. include /usr/share/nginx/modules/*.conf;
  6.  
  7. events {
  8.     worker_connections 1024;
  9. }
  10.  
  11. http {
  12.     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  13.                       '$status $body_bytes_sent "$http_referer" '
  14.                       '"$http_user_agent" "$http_x_forwarded_for"';
  15.     access_log  /var/log/nginx/access.log  main;
  16.     sendfile            on;
  17.     tcp_nopush          on;
  18.     tcp_nodelay         on;
  19.     keepalive_timeout   65;
  20.     types_hash_max_size 2048;
  21.     include             /etc/nginx/mime.types;
  22.     default_type        application/octet-stream;# Load modular configuration files from the /etc/nginx/conf.d directory.
  23.     # See http://nginx.org/en/docs/ngx_core_module.html#include
  24.     # for more information.
  25.     include /etc/nginx/conf.d/*.conf;
  26.  
  27.     server {
  28.         listen 80;
  29.         server_name shop.mydomain.com;
  30.  
  31.         location = /favicon.ico { access_log off; log_not_found off; }
  32.         location /static {
  33.             alias /home/user/shop/static;
  34.  
  35.         }
  36.  
  37.         location / {
  38.             proxy_set_header Host $http_host;
  39.             proxy_set_header X-Real-IP $remote_addr;
  40.             proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for;
  41.             proxy_set_header X-Forwarded-Proto $scheme;
  42.             proxy_pass http://unix:/run/shop.sock;
  43.             }
  44.  
  45.     }server {
  46.         listen 80;
  47.         server_name auth.mydomain.com;
  48.         location = /favicon.ico { access_log off; log_not_found off; }
  49.         location /static {
  50.                 alias /home/user/auth/static;
  51.  
  52.             }location / {
  53.             #include proxy_params;
  54.             proxy_set_header Host $http_host;
  55.             proxy_set_header X-Real-IP $remote_addr;
  56.             proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for;
  57.             proxy_set_header X-Forwarded-Proto $scheme;
  58.             proxy_pass http://unix:/run/auth.sock;
  59.         }
  60. }server {
  61.         listen       80 default_server;
  62.         listen       [::]:80 default_server;
  63.         server_name  _;
  64.         root         /usr/share/nginx/html;# Load configuration files for the default server block.
  65.         include /etc/nginx/default.d/*.conf;
  66.         location / {
  67.         }
  68.         error_page 404 /404.html;
  69.         location = /40x.html {
  70.         }
  71.         error_page 500 502 503 504 /50x.html;
  72.         location = /50x.html {
  73.         }
  74.     }
  75.  
  76. server {
  77.         listen       443 ssl http2 default_server;
  78.         listen       [::]:443 ssl http2 default_server;
  79.         server_name  shop.mydomain.com;
  80.         root         /usr/share/nginx/html;
  81.  
  82.         ssl_certificate "/etc/letsencrypt/live/mydomain.com-0001/cert.pem";
  83.         ssl_certificate_key "/etc/letsencrypt/live/mydomain.com-0001/privkey.pem";
  84.         ssl_session_cache shared:SSL:1m;
  85.         ssl_session_timeout  10m;
  86.         ssl_ciphers HIGH:!aNULL:!MD5;
  87.         ssl_prefer_server_ciphers on;
  88.  
  89.         # Load configuration files for the default server block.
  90.         include /etc/nginx/default.d/*.conf;
  91.  
  92.         location / {
  93.             proxy_set_header Host $http_host;
  94.             proxy_set_header X-Real-IP $remote_addr;
  95.             proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for;
  96.             proxy_set_header X-Forwarded-Proto $scheme;
  97.             proxy_pass http://unix:/run/shop.sock;
  98.             }
  99.  
  100.         location /static {
  101.             alias /home/user/shop/static;
  102.  
  103.         }
  104.        
  105.  
  106.         error_page 404 /404.html;
  107.             location = /40x.html {
  108.         }
  109. }
  110.     server {
  111.         listen       443 ssl http2 default_server;
  112.         listen       [::]:443 ssl http2 default_server;
  113.         server_name  auth.mydomain.com;
  114.         root         /usr/share/nginx/html;
  115.  
  116.         ssl_certificate "/etc/letsencrypt/live/mydomain.com-0001/cert.pem";
  117.         ssl_certificate_key "/etc/letsencrypt/live/mydomain.com-0001/privkey.pem";
  118.         ssl_session_cache shared:SSL:1m;
  119.         ssl_session_timeout  10m;
  120.         ssl_ciphers HIGH:!aNULL:!MD5;
  121.         ssl_prefer_server_ciphers on;
  122.  
  123.         # Load configuration files for the default server block.
  124.         include /etc/nginx/default.d/*.conf;
  125.  
  126.         location / {
  127.             proxy_set_header Host $http_host;
  128.             proxy_set_header X-Real-IP $remote_addr;
  129.             proxy_set_header X-Forwarder-For $proxy_add_x_forwarded_for;
  130.             proxy_set_header X-Forwarded-Proto $scheme;
  131.             proxy_pass http://unix:/run/auth.sock;
  132.             }
  133.        
  134.         location /static {
  135.             alias /home/user/auth/static;
  136.  
  137.         }
  138.  
  139.  
  140.         error_page 404 /404.html;
  141.             location = /40x.html {
  142.         }
  143.  
  144. }
  145. }
  146. #mail {
  147. #   # See sample authentication script at:
  148. #   # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
  149. #
  150. #   # auth_http localhost/auth.php;
  151. #   # pop3_capabilities "TOP" "USER";
  152. #   # imap_capabilities "IMAP4rev1" "UIDPLUS";
  153. #
  154. #   server {
  155. #       listen     localhost:110;
  156. #       protocol   pop3;
  157. #       proxy      on;
  158. #   }
  159. #
  160. #   server {
  161. #       listen     localhost:143;
  162. #       protocol   imap;
  163. #       proxy      on;
  164. #   }
  165. #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement