Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Nginx config for the server as SSL proxy

$
0
0
Hi!

I have several web interfaces, running on my Debian server (Deluge, BitTorrent Sync, Ajenti etc.) on different ports on localhost. To enable access from the web I setup nginx as a proxy and everything works fine for HTTP. And now I want to enable SSL to make secure access and faced with issue that my configs not working and error logs are empty.

My config template listed below. Could someone look into that?

server {
listen 80;
server_name {cp.domain.com};
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name {cp.domain.com};
client_max_body_size 20m;
access_log /var/log/nginx/{domain}.access.log;
error_log /var/log/nginx/{domain}.error.log;
ssl_certificate /etc/nginx/server.crt;
ssl_certificate_key /etc/nginx/server.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;
location / {
proxy_pass http://127.0.0.1:8000/;
proxy_set_header Host $host;
proxy_redirect http://127.0.0.1:8000/ https://{cp.domain.com}/;
}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>