I have a front and backend running on localhost:3000
and localhost:80
respectively. Both are node.js fastify
servers. Recently I went through a big headache getting CORS to work for setting cookies. But, never satisfied, I'd rather eliminate the need for CORS at all, especially because my production app does not need it.
Is it possible to somehow run some kind of proxy server or other mechanism where I could simply send requests from my frontend to api.localhost/somerequest
or something like that instead of localhost:80/somerequest
but magically have it find its way there?
I'm looking at ngix but don't even know where to start.. especially since my servers are already running on Node and I don't understand how it would integrate with ngix.
question from:
https://stackoverflow.com/questions/66056375/running-a-proxy-on-localhost-for-development 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…