Advertisement
Ruslan_Isaev

nginx config

Jun 26th, 2022
761
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2.  
  3.         # SSL configuration
  4.         #
  5.         # listen 443 ssl default_server;
  6.         # listen [::]:443 ssl default_server;
  7.         #
  8.         # Note: You should disable gzip for SSL traffic.
  9.         # See: https://bugs.debian.org/773332
  10.         #
  11.         # Read up on ssl_ciphers to ensure a secure configuration.
  12.         # See: https://bugs.debian.org/765782
  13.         #
  14.         # Self signed certs generated by the ssl-cert package
  15.         # Don't use them in a production server!
  16.         #
  17.         # include snippets/snakeoil.conf;
  18.  
  19.         root /var/www/html;
  20.  
  21.         # Add index.php to the list if you are using PHP
  22.         index index.html index.htm index.nginx-debian.html;
  23.         server_name seven-lights.xyz; # managed by Certbot
  24.  
  25.  
  26.         location / {
  27.                 # First attempt to serve request as file, then
  28.                 # as directory, then fall back to displaying a 404.
  29.                 try_files $uri $uri/ =404;
  30.         }
  31.  
  32.         location /map/ {
  33.                 proxy_pass http://127.0.0.1:8000;
  34.         }
  35.  
  36.         # pass PHP scripts to FastCGI server
  37.         #
  38.         location ~ \.php$ {
  39.                 include snippets/fastcgi-php.conf;
  40.         #
  41.         #       # With php-fpm (or other unix sockets):
  42.                 fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
  43.         #       # With php-cgi (or other tcp sockets):
  44.         #       fastcgi_pass 127.0.0.1:9000;
  45.         }
  46.  
  47.         # deny access to .htaccess files, if Apache's document root
  48.         # concurs with nginx's one
  49.         #
  50.         #location ~ /\.ht {
  51.         #       deny all;
  52.         #}
  53.  
  54.  
  55.     listen [::]:443 ssl ipv6only=on; # managed by Certbot
  56.     listen 443 ssl; # managed by Certbot
  57.     ssl_certificate /etc/letsencrypt/live/seven-lights.xyz/fullchain.pem; # managed by Certbot
  58.     ssl_certificate_key /etc/letsencrypt/live/seven-lights.xyz/privkey.pem; # managed by Certbot
  59.     include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  60.     ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
  61.  
  62. }
  63. server {
  64.     if ($host = seven-lights.xyz) {
  65.         return 301 https://$host$request_uri;
  66.     } # managed by Certbot
  67.  
  68.         listen 80 ;
  69.         listen [::]:80 ;
  70.         return 404; # managed by Certbot
  71.  
  72.  
  73. }
  74.  
Advertisement
RAW Paste Data Copied
Advertisement