Skip to content

Instantly share code, notes, and snippets.

@samazgor
Last active July 22, 2021 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samazgor/e6d696e6dcdf2d56e636b2c345be7997 to your computer and use it in GitHub Desktop.
Save samazgor/e6d696e6dcdf2d56e636b2c345be7997 to your computer and use it in GitHub Desktop.
nginx website block config sudo nano /etc/nginx/sites-available/samazgor.me
server {
listen 80;
listen [::]:80;
root /home/digitechpoint/apps/samazgor.me/public;
index index.php index.html index.htm;
server_name samazgor.me www.samazgor.me;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ .php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.4-fpm-digitechpoint.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
log_not_found off;
access_log off;
allow all;
}
location ~ ^/\.user\.ini {
deny all;
}
location ~* .(css|gif|ico|jpeg|jpg|js|png)$ {
expires max;
log_not_found off;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment