forked from BretFisher/php-docker-good-defaults
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx-site.conf
50 lines (41 loc) · 1.34 KB
/
nginx-site.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
server {
listen 80;
#listen 443 ssl;
# make sure use Swarm secrets or something to get cert and key into container
#ssl_certificate /etc/nginx/ssl/cert.crt;
#ssl_certificate_key /etc/nginx/ssl/key.pem;
# Laravel default root I think
root /var/www/app/public;
index index.php index.html index.htm;
server_name nginx;
#App paths
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
include fastcgi_params;
# Mitigate https://httpoxy.org/ vulnerabilities
fastcgi_param HTTP_PROXY "";
}
# nginx status page, you can make location whatever you want
location /status-nginx {
stub_status on;
access_log off;
}
# fpm status page and ping page
location ~ ^/(status|ping)$ {
access_log off;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/var/run/php-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}