What is the difference in configuring SSL on Sails, between set it on Nginx? -


i use nginx config:

server {     listen 80;     return 301 https://$host$request_uri; }  server {      listen 443;     server_name www.domain.com;      ssl_certificate           /etc/nginx/cert.crt;     ssl_certificate_key       /etc/nginx/cert.key;      ssl on;     ssl_session_cache  builtin:1000  shared:ssl:10m;     ssl_protocols  tlsv1 tlsv1.1 tlsv1.2;     ssl_ciphers high:!anull:!enull:!export:!camellia:!des:!md5:!psk:!rc4;     ssl_prefer_server_ciphers on;      access_log            /var/log/nginx/domain.access.log;      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;        # fix “it appears reverse proxy set broken" error.       proxy_pass          http://localhost:8086;       proxy_read_timeout  90;        proxy_redirect      http://localhost:8086 https://www.domain.com;     } } 

with have no problems, saw this question contains:

express : {     serveroptions : {         key: fs.readfilesync('ssl/server.key'),         cert: fs.readfilesync('ssl/server.crt')     } } 

what best way use https?. i'm hosted in google cloud , have pages in different port using nginx proxy_pass.

i don't know if thinking removing nginx , serving node application directly. if don't plan remove completely, rather keep configuration in nginx separate responsibilities of app , of web server.

using nginx, ready add functionalities load balancing, reverse proxy caching, serving assets more efficiently, etc...


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -