home

nginx에서 자주 사용하는 문법

기본적인 라우팅

# Common Routing server { listen 80; listen [::]:80; server_name _; location / { root /home/username/public_html/; index index.html; try_files $uri $uri/ =404; } }
Plain Text
복사

리액트 라우팅

# React Routing server { listen 80; listen [::]:80; server_name _; location / { root /home/username/public_html/; index index.html; try_files $uri $uri/ /index.html; } }
Plain Text
복사

리버스 프록시

# Reverse Proxy server { listen 80; listen [::]:80; server_name _; location / { proxy_pass http://localhost:3000; } }
Plain Text
복사