Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server
- {
- listen 443 ssl http2;
- listen [::]:443 ssl http2;
- root /var/www/html/mywebsite;
- index index.php index.html index.htm index.nginx-debian.html;
- server_name mywebsite.com www.mywebsite.com;
- location /
- {
- try_files $uri $uri/ /index.html;
- }
- location ~ \.php$
- {
- try_files $uri = 404;
- fastcgi_split_path_info ^(.+\.php)(/.+)$;
- fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- ssl_certificate /etc/letsencrypt/live/mywebsite.com/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/mywebsite.com/privkey.pem; # managed by Certbot
- }
- server
- {
- if ($host = www.mywebsite.com) {
- return 301 https://$host$request_uri;
- } # managed by Certbot
- if ($host = mywebsite.com) {
- return 301 https://$host$request_uri;
- } # managed by Certbot
- listen 80;
- listen [::]:80;
- server_name mywebsite.com www.mywebsite.com;
- return 404; # managed by Certbot
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement