-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx-default.conf
71 lines (53 loc) · 1.5 KB
/
nginx-default.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html;
#
# Error Pages
#
error_page 400 /__error__/400.html;
error_page 403 /__error__/403.html;
error_page 404 /__error__/404.html;
error_page 405 /__error__/405.html;
error_page 500 501 502 503 504 /__error__/500.html;
location ^~ /__error__/ {
internal;
alias /var/www/error/;
}
#
# All resources
#
location / {
# Set STS header for forwarded HTTPS requests
if ($http_x_forwarded_proto = 'https') {
add_header Strict-Transport-Security "max-age=31536000" always;
}
}
#
# Root Resource
#
# Redirect / -> /application/
location = / { return 301 ./application/; }
#
# PHP Application
#
# Redirect /application -> /application/
location = /application { return 301 ./; }
# PHP application
location /application/ {
# error_log /var/log/nginx/error.log debug;
alias /var/www/application/;
index index.php index.html;
location ~ [^/]\.php(/|$) {
# fastcgi_split_path_info ^(.+?\.php)(/.*)$;
try_files $uri =404;
# See https://httpoxy.org/
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/run/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
}
}