-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvhost.conf.sample
More file actions
65 lines (47 loc) · 1.8 KB
/
Copy pathvhost.conf.sample
File metadata and controls
65 lines (47 loc) · 1.8 KB
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
55
56
57
58
59
60
61
62
63
64
65
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com www.example.com
root /var/www/example.com/htdocs/
ssl on;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_prefer_server_ciphers on;
ssl_ciphers EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA512:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:ECDH+AESGCM:ECDH+AES256:DH+AESGCM:DH+AES256:RSA+AESGCM:!aNULL:!eNULL:!LOW:!RC4$
ssl_session_cache shared:TLS:2m;
# OCSP stapling
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8;
# Set HSTS to 365 days
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload';
index index.php
access_log /var/log/nginx/example.com/logs/access.log;
error_log /var/log/nginx/example.com/logs/error.log;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
#include global/fastcgi-params.conf;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_pass php7;
}
}
server {
listen 80;
listen [::]:80;
server_name nimdam.com www.nimdam.com;
return 301 https://example.com$request_uri;
}
# Redirect www to non-www
server {
listen 443 ssl;
listen [::]:443;
server_name www.example.com;
return 301 https://example.com$request_uri;
}