Skip to content

Instantly share code, notes, and snippets.

@Nyoho
Last active May 17, 2018 07:26
Show Gist options
  • Save Nyoho/c6c628e97a3521270c8e636e735610bf to your computer and use it in GitHub Desktop.
Save Nyoho/c6c628e97a3521270c8e636e735610bf to your computer and use it in GitHub Desktop.
nginx setting for LTI reverse proxy
server {
listen 80;
listen [::]:80;
server_name lti.nyoho.jp;
root /var/www/lti.nyoho.jp;
location /.well-known/acme-challenge/ { allow all; }
location / { return 301 https://$host$request_uri; }
}
server {
listen 443 ssl;
ssl on;
ssl_certificate /etc/letsencrypt/live/lti.nyoho.jp/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/lti.nyoho.jp/privkey.pem;
server_name lti.nyoho.jp;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_ciphers EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:128m;
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains;';
# TODO: add always
add_header X-Content-Type-Options "nosniff";
# add_header X-Frame-Options "SAMEORIGIN";
# add_header X-Xss-Protection "1";
# add_header Content-Security-Policy "default-src 'self'";
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/lti.nyoho.jp/fullchain.pem;
resolver 8.8.8.8;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:18888;
}
access_log /var/log/nginx/lti-access.log ltsv;
error_log /var/log/nginx/lti-error.log;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment