Created
October 3, 2023 03:15
-
-
Save qolarnix/d7b42f26deb464300b5aa3b7401607a5 to your computer and use it in GitHub Desktop.
nginx config linode stackscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name example.com www.example.com; | |
root /var/www/landing/public_html; | |
index index.php; | |
location / { | |
try_files $uri $uri/ /index.php?q=$uri&$args; | |
rewrite ^([^.]*[^/])$ $1/ permanent; | |
} | |
location ~* \.php$ { | |
fastcgi_pass unix:/run/php/php8.2-fpm.sock; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
} | |
if ($host = 'www.example.com') { | |
return 301 https://example.com$request_uri; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment