Advertisement
Guest User

Untitled

a guest
Oct 24th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.76 KB | None | 0 0
  1. server {
  2.     listen 443 ssl http2;
  3.     listen [::]:443 ssl http2;
  4.  
  5.     server_name project.ru;
  6.     root /var/www/project;
  7.  
  8.     # SSL
  9.     ssl_certificate /etc/letsencrypt/live/project.ru/fullchain.pem;
  10.     ssl_certificate_key /etc/letsencrypt/live/project.ru/privkey.pem;
  11.     ssl_trusted_certificate /etc/letsencrypt/live/project.ru/chain.pem;
  12.  
  13.     # security
  14.     include nginxconfig.io/security.conf;
  15.  
  16.     location /static {
  17.         root /var/www/project;
  18.     }
  19.  
  20.     # reverse proxy
  21.     location / {
  22.         proxy_pass http://127.0.0.1:8004;
  23.         include nginxconfig.io/proxy.conf;
  24.     }
  25.  
  26.     # additional config
  27.     include nginxconfig.io/general.conf;
  28. }
  29.  
  30. # HTTP redirect
  31. server {
  32.     listen 80;
  33.     listen [::]:80;
  34.  
  35.     server_name project.ru;
  36.  
  37.     include nginxconfig.io/letsencrypt.conf;
  38.  
  39.     location / {
  40.         return 301 https://project.ru$request_uri;
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement