-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample_ssl_conf
49 lines (39 loc) · 1.21 KB
/
sample_ssl_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
server {
listen 80;
# Domain Name
# Modify - Domain name as yours
server_name www.example.com example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
# Domain Name
# Modify - Domain name as yours
server_name example.com;
ssl on;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
underscores_in_headers on;
client_max_body_size 10M;
# Log files for Debugging
# Modify - Error log name as yours
error_log /var/log/nginx/example.com-error.log;
# Webroot Directory for project
# Modify - WebRoot name as yours
root /var/www/example.com;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# PHP-FPM Configuration Nginx
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Modify - PHP version name as yours
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_cache off;
include fastcgi_params;
}
}