Skip to content

Instantly share code, notes, and snippets.

@qolarnix
Created October 3, 2023 03:15
Show Gist options
  • Save qolarnix/d7b42f26deb464300b5aa3b7401607a5 to your computer and use it in GitHub Desktop.
Save qolarnix/d7b42f26deb464300b5aa3b7401607a5 to your computer and use it in GitHub Desktop.
nginx config linode stackscript
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