Files
nexus/wiki/entities/Nginx.md
2026-04-14 16:02:50 +08:00

37 lines
680 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Nginx"
type: entity
tags: [web-server, reverse-proxy]
sources: [tiktok-pm-python-django-project.md]
last_updated: 2026-04-14
---
## Definition
Nginx是一个高性能的HTTP服务器和反向代理。
## Role in TikTok PM Project
- 作为反向代理将请求转发给Gunicorn
- 提供静态文件服务(/static/和/media/
- 监听80端口
## Configuration
```nginx
upstream web {
server web:8000;
}
server {
listen 80;
location /static/ {
alias /app/staticfiles/;
}
location / {
proxy_pass http://web;
}
}
```
## Connections
- [[Nginx]] ← proxies_to ← [[Gunicorn]]
- [[Nginx]] ← serves_static ← [[Django]]