Skip to content

Instantly share code, notes, and snippets.

@v3ronez
Last active April 13, 2023 17:17
Show Gist options
  • Select an option

  • Save v3ronez/1134b2dd2485047619d3ab5995fc1899 to your computer and use it in GitHub Desktop.

Select an option

Save v3ronez/1134b2dd2485047619d3ab5995fc1899 to your computer and use it in GitHub Desktop.
nginx basic config php8.1
server {
listen 80;
index index.php index.html index;
root /var/www/public;
location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}
location ~ \.php$ {
#include snippets/fastcgi-php.conf;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000; #app é o nome do service do docker compose
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
# With php7.0-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php7.0-fpm:
#fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment