Skip to content

Instantly share code, notes, and snippets.

@halidaltuner
Last active August 29, 2017 08:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save halidaltuner/8fe138babedcb280c784 to your computer and use it in GitHub Desktop.
Save halidaltuner/8fe138babedcb280c784 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