Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
Created October 24, 2024 11:15
Show Gist options
  • Select an option

  • Save ZiTAL/94f9ee6c64f322324819c58132ee9350 to your computer and use it in GitHub Desktop.

Select an option

Save ZiTAL/94f9ee6c64f322324819c58132ee9350 to your computer and use it in GitHub Desktop.
ERR_SSL_PROTOCOL_ERROR: fix nginx
server {
include /etc/nginx/vhost.conf.d/http.conf;
server_name example.domain.eus
root /var/www/html
location /search {
proxy_pass http://example.domain.eus:8080/search;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_log /var/log/nginx/example-error.log error;
access_log /var/log/nginx/example-access.log;
}
server {
include /etc/nginx/vhost.conf.d/http.conf;
server_name example.domain.eus
root /var/www/html
location /search {
proxy_pass http://example.domain.eus:8080/search;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_log /var/log/nginx/example-error.log error;
access_log /var/log/nginx/example-access.log;
}
listen 80;
if ($server_port = 80) {
return 302 https://$server_name$request_uri;
}
listen 443 ssl;
ssl_certificate /etc/letsencrypt/live/example.com-0002/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com-0002/privkey.pem;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment