@Madchatthew Iād always post for the reasons I stated above. Itās useful information and could save someone else the headache.
Digitalocean step by step guide to nginx configuration
-
@justoverclock You can use either, but if the API is not meant to be exposed publicly, and should only be accessed by the app itself, then you should use
127.0.0.1
. Ultimately, the design is up to you. -
@phenomlab well, iāve learned something new, no its a private crm developed by me, so no external use
-
@justoverclock Exactly - thatās why I asked You wonāt be exposing the API then. Any issues, let me know.
-
@phenomlab ok iāll try later when people are not using the crm :P, and iāll post here the result
-
@justoverclock No problems.
-
-
-
@phenomlab its odd but doesnāt work if i use https://vfgest.it:3030 or https://SERVERIP:3030 or https://127.0.0.1:3030
must be something related to proxyā¦because server and client are on the same serverā¦but works if i restore all to previous unsecure http connection
-
@justoverclock iāve found an article that says
To resolve your issue you can setup nginx to proxy your http backend urls via https. With nginx server you will need to call your api like https://your_domain/api/some_path and nginx will proxy your request to api host, that you will set in configso my server actually is on port 3030, what should i do?
thx!
-
@justoverclock ok iāve found the solution by myself watching your filesā¦
-iāve created a subdomain
- a new server blocks that proxy requests to the backend endpoint
- secured with certbot
all works fine
-
@justoverclock Beat me to it ! I was going to say that you could add another server block to the existing configuration, so for example
location /api { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://127.0.0.1:3030/; proxy_redirect off; # Socket.IO Support proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; }
-
@phenomlab iām learning ahahahah
-
@justoverclock said in Digitalocean step by step guide to nginx configuration:
iām learning
And thatās the whole point of this site If you donāt learn anything, you gain nothing.
Did this solution help you?
Related Topics
-
configure ghost and wordpress combo
Moved Solved WordPress -
-
Is nginx necessary to use?
Moved Solved Hosting -
-
-
nginx seo urls
Solved Configure -
-