🔒 Closed How to reverse proxy your developed web application using nginx (Django, Nodejs, or any)

Status
Not open for further replies.

raevillena

Fanatic
Dito mag bibigay ako ng sample para mag configure sa nginx ng mga developed apps/backend/listeners nyo galing sa nodejs, uwsgi or anything similar.
Usually deployed ang mga backend apps or servers sa mga port na non standard and hindi maganda sa eyes pag ginagamit na ng user.
Usually gusto naten is padaanin sa port 80, 443 or http and https. Nasa baba yung sample ng code snippet para sa isang simple na deployment.

Assumptions:
  1. you have app running at port 8000
  2. it can be accessed at 127.0.0.1 internally
  3. you have "example.com" as you domain pointing at the server
  4. nasa /var/www/example.com ang mga static files mo

server { listen 80 default_server; listen [::]:80 default_server; server_name example.com; root /var/www/example.com; index index.html index.htm index.nginx-debian.html; location / { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_pass http://127.0.0.1:8000; #include /etc/nginx/uwsgi_params; #block for uwsgi standard params #uwsgi_pass unix:///home/user/dashboard.sock; } location /static { alias /home/user/static; #pwede magset ng seperate alias for a folder kung saan palaging naka tingin ang /static/ sa url } }
 
Status
Not open for further replies.

About this Thread

  • 1
    Replies
  • 532
    Views
  • 2
    Participants
Last reply from:
Haynakoha

Trending Topics

Online now

Members online
1,114
Guests online
2,429
Total visitors
3,543

Forum statistics

Threads
2,315,679
Posts
29,183,558
Members
1,182,673
Latest member
meatmallet
Back
Top