Nginx config:修订间差异
标签:2017版源代码编辑 |
标签:2017版源代码编辑 |
||
(未显示同一用户的1个中间版本) | |||
第18行: | 第18行: | ||
==Reverse proxy== | ==Reverse proxy== | ||
Note: be careful that the backend should also use correct config. | |||
<syntaxhighlight lang="nginx"> | |||
server { | |||
index index.html index.htm index.nginx-debian.html; | |||
server_name yai.ink; | |||
location / { | |||
proxy_pass http://localhost:8000; | |||
} | |||
} | |||
</syntaxhighlight> | |||
[[Category:Linux/Unix]] | [[Category:Linux/Unix]] |
2024年12月7日 (六) 03:21的最新版本
Configuration
Serve React
Note:
- Solve browser route 404:[1]
server {
root /var/www/html;
server_name yai.ink;
location / {
try_files $uri $uri/ /index.html;
}
}
Reverse proxy
Note: be careful that the backend should also use correct config.
server {
index index.html index.htm index.nginx-debian.html;
server_name yai.ink;
location / {
proxy_pass http://localhost:8000;
}
}