Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.72 KB | None | 0 0
  1. # For more information on configuration, see:
  2. #   * Official English Documentation: http://nginx.org/en/docs/
  3. #   * Official Russian Documentation: http://nginx.org/ru/docs/
  4.  
  5. user root;
  6. worker_processes auto;
  7. error_log /var/log/nginx/error.log;
  8. pid /run/nginx.pid;
  9.  
  10. # Load dynamic modules. See /usr/share/nginx/README.dynamic.
  11. include /usr/share/nginx/modules/*.conf;
  12.  
  13. events {
  14.     worker_connections 1024;
  15. }
  16.  
  17. http {
  18.     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  19.                       '$status $body_bytes_sent "$http_referer" '
  20.                       '"$http_user_agent" "$http_x_forwarded_for"';
  21.  
  22.     access_log  /var/log/nginx/access.log  main;
  23.  
  24.     sendfile            on;
  25.     tcp_nopush          on;
  26.     tcp_nodelay         on;
  27.     keepalive_timeout   65;
  28.     types_hash_max_size 2048;
  29.  
  30.     include             /etc/nginx/mime.types;
  31.     default_type        application/octet-stream;
  32.  
  33.     include /etc/nginx/conf.d/*.conf;
  34.  
  35.     server {
  36.         server_name  domain.od.ua;
  37.         root         /app;
  38.  
  39.         # Load configuration files for the default server block.
  40.         include /etc/nginx/default.d/*.conf;
  41.  
  42.         location / {
  43.                 proxy_pass http://8.8.8.8:8080;
  44.                 proxy_http_version 1.1;
  45.                 proxy_set_header Upgrade $http_upgrade;
  46.                 proxy_set_header Connection 'upgrade';
  47.                 proxy_set_header Host $host;
  48.                 proxy_cache_bypass $http_upgrade;
  49.  
  50.         }
  51.  
  52.         location /api {
  53.                 proxy_pass http://8.8.8.8:3001;
  54.                 proxy_http_version 1.1;
  55.                 proxy_set_header Upgrade $http_upgrade;
  56.                 proxy_set_header Connection 'upgrade';
  57.                 proxy_set_header Host $host;
  58.                 proxy_cache_bypass $http_upgrade;
  59.         }
  60.  
  61.         error_page 404 /404.html;
  62.             location = /40x.html {
  63.         }
  64.  
  65.         error_page 500 502 503 504 /50x.html;
  66.             location = /50x.html {
  67.         }
  68.    
  69.     listen [::]:443 ssl ipv6only=on; # managed by Certbot
  70.     listen 443 ssl; # managed by Certbot
  71.     ssl_certificate /etc/letsencrypt/live/domain.od.ua/fullchain.pem; # managed by Certbot
  72.     ssl_certificate_key /etc/letsencrypt/live/domain.od.ua/privkey.pem; # managed by Certbot
  73.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  74.     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  75.  
  76. }
  77.  
  78.     server {
  79.     if ($host = domain.od.ua) {
  80.         return 301 https://$host$request_uri;
  81.     } # managed by Certbot
  82.  
  83.  
  84.         listen       80 default_server;
  85.         listen       [::]:80 default_server;
  86.         server_name  domain.od.ua;
  87.     return 404; # managed by Certbot
  88.  
  89. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement