I am trying to make a reverse proxy server with Nginx, i have a Proxy (for HTTP) and a Proxy-SSL (For HTTPS)
I have some problems with the Proxy-SSL (HTTPS) I am getting a bad gateway 502 error when i am trying to connect to https://owncloud.example.eu
but when i use https for my example.eu site then everything is working flawless
the backend servers are LAMP’server
The logs are empty.
server {
listen 443 ssl;
server_name example.eu;
ssl on;
ssl_certificate /etc/nginx/ssl/wordpress/wordpress.crt;
ssl_certificate_key /etc/nginx/ssl/wordpress/wordpress.key;
#ssl_trusted_certificate /etc/nginx/ssl/path/ca-certs.pem;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don't use SSLv3 because of killer poodles
#Uncomment to enable the settings
#gzip on;
location / {
# app1 reverse proxy follow
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://10.0.2.5:443;
}
}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # Webserver 2 # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
server {
listen 443 ssl;
server_name owncloud.example.eu;
ssl on;
ssl_certificate /etc/nginx/ssl/owncloud /owncloud.crt;
ssl_certificate_key /etc/nginx/ssl/owncloud/owncloud.key;
#ssl_trusted_certificate /etc/nginx/ssl/path/ca-certs.pem;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don't use SSLv3 because of killer poodles
#Uncomment to enable the settings
#gzip on;
location / {
# app1 reverse proxy follow
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass https://10.0.2.7:443;
}
}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Did you set the SELinux? Maybe this article will help you: https://www.nginx.com/blog/nginx-se-linux-changes-upgrading-rhel-6-6/
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.