-
Notifications
You must be signed in to change notification settings - Fork 45
/
nginx6.conf
54 lines (39 loc) · 1.08 KB
/
nginx6.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
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
client_max_body_size 1000m;
#上传限制参数1G以内文件可上传
# HTTP server
server {
listen 80;
server_name yuming.com;
# Redirect all HTTP requests to HTTPS
return 301 https://$host$request_uri;
}
# HTTPS server
server {
listen 443 ssl http2;
server_name yuming.com;
# http2 on;
ssl_certificate /etc/nginx/certs/cert.pem;
ssl_certificate_key /etc/nginx/certs/key.pem;
root /var/www/html;
index index.php;
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^/vip.php(.*)$ /vip.php?s=$1 last;
rewrite ^/api.php(.*)$ /api.php?s=$1 last;
try_files $uri $uri/ =404;
# PHP-FPM configuration
location ~ \.php$ {
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}