Skip to content

Instantly share code, notes, and snippets.

@marianmirzacu
Last active November 24, 2023 13:48
Show Gist options
  • Save marianmirzacu/6f57b8806e27c7bf8412 to your computer and use it in GitHub Desktop.
Save marianmirzacu/6f57b8806e27c7bf8412 to your computer and use it in GitHub Desktop.
nginx config file for laravel with php7.3
server {
server_name DOMAIN_NAME;
access_log /var/log/nginx/DOMAIN_NAME_access.log;
error_log /var/log/nginx/DOMAIN_NAME_error.log;
rewrite_log on;
root /var/www/DOMAIN_NAME/public;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}
location ~ /\.ht {
deny all;
}
# Set header expirations on per-project basis
location ~* \.(?:ico|css|js|jpe?g|JPG|png|gif|svg|woff)$ {
expires 365d;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment