-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathnginx_vhost_https.conf
More file actions
40 lines (31 loc) · 963 Bytes
/
nginx_vhost_https.conf
File metadata and controls
40 lines (31 loc) · 963 Bytes
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
# HTTPS Application
server {
# Application Path
root /path/to/app/public/path;
# Index Application File
index index.php;
# Listen to hosts
server_name app.com www.app.com;
# Enable SSL
ssl on;
# Listen on HTTPS Port using HTTP2 (IPv4)
listen 443 http2;
# Listen on HTTPS Port using HTTP2 (IPv6)
listen [::]:443 http2;
# SSL Certificate File
ssl_certificate /etc/letsencrypt/live/app.com/fullchain.pem;
# SSL Private Key
ssl_certificate_key /etc/letsencrypt/live/app.com/privkey.pem;
# URL Rewrite Rules
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
# PHP Backend Config
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm-myapp.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}