Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save seinecle/06bde086330264b9681d2e721d0ed19e to your computer and use it in GitHub Desktop.
Save seinecle/06bde086330264b9681d2e721d0ed19e to your computer and use it in GitHub Desktop.
glassfish + nginx + ssl
upstream glassfish_server {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
server_name berat.com;
return 301 https://$server_name$request_uri;
}
server {
server_name berat.com;
listen 443;
ssl on;
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_certificate /var/certs/server.crt;
ssl_certificate_key /var/certs/server.key;
ssl_session_cache shared:SSL:10m;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
proxy_connect_timeout 240;
proxy_send_timeout 240;
proxy_read_timeout 240;
proxy_pass http://glassfish_server;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment