Skip to content

Instantly share code, notes, and snippets.

@neerfix
Last active March 14, 2023 14:15
Show Gist options
  • Save neerfix/77d2cb3d733986a11ae8c3c724593da6 to your computer and use it in GitHub Desktop.
Save neerfix/77d2cb3d733986a11ae8c3c724593da6 to your computer and use it in GitHub Desktop.
example of nginx-conf in docker
server {
server_name www.example.local;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /app/public;
listen 80;
location / {
# try to serve file directly, fallback to app.php
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass php:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
}
location ~ \.php$ {
return 404;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment