Wlski
WWasp-lang
•Created by Wlski on 9/5/2024 in #đŸ™‹questions
Nginx ssl certificates broke client/server communication?
Use this with the client deployment script in the docs: REACT_APP_API_URL=https:/domain.com/server/ ./setup_client_deployment.sh
In your docker compose you set
wasp-server:
WASP_WEB_CLIENT_URL=https://domain.com
WASP_SERVER_URL=https://domain.com/server/
wasp-client:
REACT_APP_API_URL=https:/domain.com/server/
Nginx also needs to be defined here.
nginx.conf:
upstream wasp-frontend {
server wasp-client:8043;
}
upstream wasp-backend {
server wasp-server:3001;
}
location / {
proxy_pass http://wasp-frontend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /domain.com/server/ {
proxy_pass http://wasp-backend/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
It's a little more complicated than this but these are the key elements that could get you on digital ocean @martinsos
26 replies
WWasp-lang
•Created by Wlski on 9/5/2024 in #đŸ™‹questions
Nginx ssl certificates broke client/server communication?
Nice. Sorry—I'm relatively new to discord so I'm not around here often
26 replies
WWasp-lang
•Created by Wlski on 9/5/2024 in #đŸ™‹questions
Nginx ssl certificates broke client/server communication?
@cmilazzo What are you deploying on
26 replies
WWasp-lang
•Created by Wlski on 9/5/2024 in #đŸ™‹questions
Nginx ssl certificates broke client/server communication?
Update: Figured this out. It was another instance of nginx running on port 80 which initially didnt catch me off guard because I thought it was my docker container but turns out nginx was installed to run by default at startup. This came from using certbot to install ssl certificates.
Feel like an idiot. @miho thanks for the help though.
26 replies
WWasp-lang
•Created by Wlski on 9/5/2024 in #đŸ™‹questions
Nginx ssl certificates broke client/server communication?
apologies for how all over the place I am with this. first time deploying so still figuring things out
26 replies
WWasp-lang
•Created by Wlski on 9/5/2024 in #đŸ™‹questions
Nginx ssl certificates broke client/server communication?
Im also deploying directly to my owned domain. so when I say domain.com I mean I own that and need to correlate dns records. Which might mean somewhere I'm also having a firewall issue
26 replies
WWasp-lang
•Created by Wlski on 9/5/2024 in #đŸ™‹questions
Nginx ssl certificates broke client/server communication?
i know this might be a crazy ask but do you have a working nginx template for wasp frontend and backend?
I can't seem to get the api prefix working so I've reverted to trying to handle a /server/ workaround in the routing. naturally I don't think this was intended at all but since I could never get it set up I kind of gave up on it.
so in essence docker-compose.yml setting:
WASP_WEB_CLIENT_URL=https://domain.com
WASP_SERVER_URL=https://domain.com/server/
JWT_SECRET=[normal 32L string]
MAILGUN_API_KEY=[key]
MAILGUN_DOMAIN=mail.domain.com
PORT=3001
REACT_APP_API_URL=https://domain.com/server/
(before pulling from git I also run the wasp build/npm install script with this var)
26 replies
WWasp-lang
•Created by Wlski on 9/5/2024 in #đŸ™‹questions
Nginx ssl certificates broke client/server communication?
just troubleshooting weird issues with nginx rerouting my api only sometimes. but is callable from curl to get to endpoints I want. So must be env vars issue
26 replies
WWasp-lang
•Created by Wlski on 9/5/2024 in #đŸ™‹questions
Nginx ssl certificates broke client/server communication?
and yeah docker-compose.yml is what I'm using
26 replies
WWasp-lang
•Created by Wlski on 9/5/2024 in #đŸ™‹questions
Nginx ssl certificates broke client/server communication?
I think I'm starting to get the hang of it. is WASP_SERVER_URL the same as REACT_APP_API_URL?
26 replies
WWasp-lang
•Created by DanjelDurmo on 9/4/2024 in #đŸ™‹questions
deployment with Digital Ocean
to clarify this is currently on digital ocean
13 replies
WWasp-lang
•Created by DanjelDurmo on 9/4/2024 in #đŸ™‹questions
deployment with Digital Ocean
Not on wasp team but was able to get something up and running with docker compose earlier today. Make sure everything is set up with proper env vars (wasp handles these differently, need to be injected either through docker-compose.yml or script in build process as opposed to .env files) and also mind your way around using wasp build etc. would definitely recommend a dockerfile similar to the one they outline for railway manual deployment in the docs.
13 replies