SteveLTN / https-portal

A fully automated HTTPS server powered by Nginx, Let's Encrypt and Docker.
MIT License
4.46k stars 295 forks source link

WebSockets and CORS #228

Closed stefanvoicila closed 4 years ago

stefanvoicila commented 4 years ago

After i added " WEBSOCKET: 'true' " the signalR requests of my project are working but the REST HTTP Requests stopped working because of CORS. The inverse is true if I remove the line, signalR stops working (which is to be expected) but the other requests work flawlessly.

This is my docker-compose.yml:

Basically, I've found that every request that has the [Authorize] tag fails on CORS when using the WEBSOCKET: 'true' line in docker-compose.yml

` version: '2' services: app: build: context: ./ dockerfile: Dockerfile https-portal: image: steveltn/https-portal:1 ports:

Also, if I run the project using "dotnet run" everything works as expected, so I think there is a problem with my docker configuration.

Any ideas?

SteveLTN commented 4 years ago

I think you probably need to configure your own CORS headers. Take a look at how to provide your own Nginx config.