-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnginx.conf
42 lines (36 loc) · 1.37 KB
/
nginx.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
server {
server_name ${server_domain};
listen 443 ssl http2;
listen 80;
root ${project_root}/Public/;
#SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
#error_page 404/404.html;
#SSL-END
#ERROR-PAGE-START 错误页配置,可以注释、删除或修改
#error_page 404 /404.html;
#error_page 502 /502.html;
#ERROR-PAGE-END
location @proxy {
proxy_pass http://127.0.0.1:${server_port};
proxy_pass_header Server;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Server;
proxy_connect_timeout 3s;
proxy_read_timeout 10s;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
try_files $uri @proxy; #这里是页面重定向、让80端口可以重定向到我们的服务器。
#try_files $uri $uri/ /index.php?$query_string; #添加url重定向,>这在laravel文档中有写
}
#一键申请SSL证书验证目录相关设置
location ~ \.well-known{
allow all;
}
access_log ${nginx_log_root_path}/${server_domain}.log;
error_log ${nginx_log_root_path}/${server_domain}.error.log;
}