Skip to content

Instantly share code, notes, and snippets.

@atmouse-
Last active October 12, 2020 13:26
Show Gist options
  • Save atmouse-/3dd18b3a95b82edc5c3372305f023323 to your computer and use it in GitHub Desktop.
Save atmouse-/3dd18b3a95b82edc5c3372305f023323 to your computer and use it in GitHub Desktop.
Nginx php-fpm configure
server {
listen 80 default;
server_name _;
index index.html index.php;
root /var/www/html;
location ~ /\.ht {
deny all;
}
location ~ /\.(svn|git) {
deny all;
}
location ~ ^/(WEB-INF)/ {
deny all;
}
location = /healthz {
root /usr/share/nginx/html;
try_files $uri @healthz;
access_log off;
}
location @healthz {
fastcgi_pass php-fpm:9000;
fastcgi_read_timeout 10;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
access_log off;
}
# addition config here
location ~* .*\.(gif|jpg|jpeg|png|bmp|swf|js|css)($|/) {
access_log off;
}
location ~* .*\.php($|/) {
fastcgi_pass php-fpm:9000;
fastcgi_read_timeout 300;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
server {
listen 80;
server_name support.example.com;
access_log off;
client_max_body_size 100M;
client_body_buffer_size 10M;
include /etc/nginx/proxy-*.conf;
location / {
proxy_pass http://localhost:8080;
}
}
;include_path = "."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment