jonra1993 / fastapi-alembic-sqlmodel-async

This is a project template which uses FastAPI, Pydantic 2.0, Alembic and async SQLModel as ORM. It shows a complete async CRUD using authentication and role base access control.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Caddy not working with reverse proxy on remote host

bazylhorsey opened this issue · comments

I tested this on an EC2, even when providing the elastic IP to the EXT_ENDPOINT1, none of the subdomains could be reached. Although I was able to get the docs on http://{ELASTIC_IP]/docs

I also noticed that while fastapi.localhost works locally to get the hello world json response, fastapi.localhost/docs did not load the docs page. The only way to get the docs locally from my testing was localhost/docs on port 80.
Is there any way to get ssl behavior working using an elastic ip? Or do you have to own a dns to get an ssl cert working?

Hello, @bazylhorsey I have a couple of elastic Beanstalk servers running with caddy without problems and they are connected with custom domains using some DNS providers like Cloudflare, and Route53. I have not tested with static IP on a remote server I am going to check it over the weekend on HTTP it should work perfectly.

On my local environment on HTTP mode everything works correctly did you try to clean the cache or open it in an incognito docs?

SSL works with domains, not elastic IP addresses if you just have IP addresses you should use better HTTP.
Please check this link seems at least free certificates can not be generated with IP addresses.

Also check this