Last active
March 14, 2023 14:15
-
-
Save neerfix/77d2cb3d733986a11ae8c3c724593da6 to your computer and use it in GitHub Desktop.
example of nginx-conf in docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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