-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvirtualhost-ssl-sample
38 lines (30 loc) · 1013 Bytes
/
virtualhost-ssl-sample
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
server {
listen 80;
server_name KX_DOMAINNAME www.KX_DOMAINNAME;
location / {
return 301 https://KX_DOMAINNAME$request_uri;
}
}
server {
server_name KX_DOMAINNAME www.KX_DOMAINNAME;
listen 443 ssl http2;
ssl_certificate /etc/letsencrypt/live/KX_DOMAINNAME/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/KX_DOMAINNAME/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/KX_DOMAINNAME/fullchain.pem;
include /etc/nginx/snippets/ssl.conf;
root /var/www/html/KX_DOMAINNAME;
index index.php;
location / {
#try_files $uri $uri/ /index.php;
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
access_log /var/log/nginx/KX_DOMAINNAME-access.log;
error_log /var/log/nginx/KX_DOMAINNAME-error.log;
}