Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.05 KB | None | 0 0
  1. server {
  2.     listen 80 default_server;
  3.     listen [::]:80 default_server;
  4.     root /var/www/html;
  5.     index index.html index.htm index.nginx-debian.html;
  6.     server_name momentum-bots.top www.momentum-bots.top;
  7.     location / {
  8.         try_files $uri $uri/ =404;
  9.     }
  10.     if ($scheme = http) {
  11.         return 301 https://$server_name$request_uri;
  12.     }
  13. }
  14.  
  15. server {
  16.     listen 443 ssl default_server;
  17.     listen [::]:443 ssl default_server;
  18.  
  19.   ssl on;
  20.   ssl_certificate     /etc/ssl/momentum-bots.top.crt;
  21.   ssl_certificate_key /etc/ssl/private.key;
  22.  
  23.     # SSL configuration
  24.     #
  25.     # listen 443 ssl;
  26.     # listen [::]:443 ssl;
  27.     #
  28.     # Note: You should disable gzip for SSL traffic.
  29.     # See: https://bugs.debian.org/773332
  30.     #
  31.     # Read up on ssl_ciphers to ensure a secure configuration.
  32.     # See: https://bugs.debian.org/765782
  33.     #
  34.     # Self signed certs generated by the ssl-cert package
  35.     # Don't use them in a production server!
  36.     #
  37.     # include snippets/snakeoil.conf;
  38.  
  39.     root /var/www/html;
  40.  
  41.     # Add index.php to the list if you are using PHP
  42.     index index.php index.html index.htm index.nginx-debian.html;
  43.  
  44.     server_name momentum-bots.top;
  45.  
  46.     if ($request_uri ~ "/index.(php|html?)") {
  47.             rewrite ^ /$1 permanent;
  48.         }
  49.  
  50.     location / {
  51.         # First attempt to serve request as file, then
  52.         # as directory, then fall back to displaying a 404.
  53.         # try_files $uri $uri/ =404;
  54.     try_files $uri $uri/ /index.php$is_args$args;
  55.     }
  56.  
  57.   location = /favicon.ico { log_not_found off; access_log off; }
  58.     location = /robots.txt { log_not_found off; access_log off; allow all; }
  59.     location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
  60.         expires max;
  61.         log_not_found off;
  62.     }
  63.  
  64.     # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  65.     #
  66.     location ~ \.php$ {
  67.         include snippets/fastcgi-php.conf;
  68.     #
  69.     #   # With php7.0-cgi alone:
  70.     #   fastcgi_pass 127.0.0.1:9000;
  71.     #   # With php7.0-fpm:
  72.         fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  73.     }
  74.  
  75.     # deny access to .htaccess files, if Apache's document root
  76.     # concurs with nginx's one
  77.     #
  78.     location ~ /\.ht {
  79.         deny all;
  80.     }
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement