Advertisement
letterheadno5683

React and Nginx Full

Nov 19th, 2023 (edited)
1,898
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.22 KB | None | 0 0
  1. server {
  2.  
  3.        server_name domainname;
  4.  
  5.        root /var/www/domainname;
  6.  
  7.        location / {
  8.                try_files $uri $uri/ =404;
  9.        }
  10.        
  11.         location /project1/ {
  12.                 root /var/www/domainname/project1/;
  13.                 try_files $uri /index.html;
  14.         }
  15.        
  16.         location /project2/ {
  17.                 root /var/www/domainname/project2/;
  18.                 try_files $uri /index.html;
  19. }
  20.  
  21.     listen [::]:443 ssl; # managed by Certbot
  22.     listen 443 ssl; # managed by Certbot
  23.     ssl_certificate /etc/letsencrypt/live/domainname/fullchain.pem; # managed by Certbot
  24.     ssl_certificate_key /etc/letsencrypt/live/domainname/privkey.pem; # managed by Certbot
  25.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  26.     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  27.  
  28. }
  29. server {
  30.     if ($host = domainname) {
  31.         return 301 https://$host$request_uri;
  32.     } # managed by Certbot
  33.  
  34.  
  35.         listen 80;
  36.         listen [::]:80;
  37.  
  38.        server_name domainname;
  39.     return 404; # managed by Certbot
  40.  
  41.  
  42. }                                                                                                                      1,1           Top
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement