Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
How to set up Nginx behind a Digital Ocean Load Balancer with SSL Termination
I have set up a load balancer with SSL termination. Behind this I have set up an Node Express server using NGinx as a reverse proxy to allow traffic from port 80 to redirect to my Express server running on port 4000. I have set this up using the NGINXConfig tool, config found here
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Oddly, when I had this set up with HTTPS between my NGinx proxy and the loadbalancer (without SSL Termination on the load balancer) this worked fine and I did not see CORS errors.
I assume this is down to the
/etc/nginx/nginxconfig.io/security.conf file created by the NGINXConfig tool and the fact that the connection goes from HTTPS to HTTP, however I do not know what the correct secure config here should be and was wondering if anyone could help out?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×