-
Notifications
You must be signed in to change notification settings - Fork 1
/
ghost
70 lines (57 loc) · 2.21 KB
/
ghost
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
66
67
68
69
70
server {
# Puerto a escuchar para HTTPS
listen 443 ssl;
# Descomentar esta línea para activar el protocolo HTTP2
# ssl http2;
# Datos del servidor
server_name TUDOMINIO.COM www.TUDOMINIO.COM;
# Directorio de los certificados
ssl_certificate /etc/letsencrypt/live/TUDOMINIO.COM/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/TUDOMINIO.COM/privkey.pem;
# Turn on OCSP stapling as recommended at
# https://community.letsencrypt.org/t/integration-guide/13123
# requires nginx version >= 1.3.7
ssl_stapling on;
ssl_stapling_verify on;
# Uncomment this line only after testing in browsers, as it
# commits you to continuing to serve your site over HTTPS in
# future add_header Strict-Transport-Security "max-age=31536000";
add_header Strict-Transport-Security "max-age=31536000";
# Configuración de los logs del site
access_log /var/log/nginx/TUDOMINIO.COM.access;
error_log /var/log/nginx/TUDOMINIO.COM.error error;
# Configuración del módulo Pagespeed
pagespeed on;
# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
# Ensure requests for pagespeed optimized resources go to the pagespeed handler
# and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
# maintain the .well-known directory alias for renewals
location /.well-known {
alias /var/www/ghost/.well-known;
}
# Configuración del proxy al puerto de Ghost
location / {
proxy_pass http://localhost:2368;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
}
}
server {
# Redirección del puerto 80 al 443
listen 80;
server_name TUDOMINIO.COM www.TUDOMINIO.COM;
rewrite ^ https://$host$request_uri? permanent;
}
server {
# Redirección de www a sin www
server_name www.TUDOMINIO.COM;
return 301 $scheme://eiris.es$request_uri;
}