61 lines
1.5 KiB
Plaintext
61 lines
1.5 KiB
Plaintext
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name mcp.example.com;
|
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
root /var/www/html;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
http2 on;
|
|
server_name mcp.example.com;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/mcp.example.com/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/mcp.example.com/privkey.pem;
|
|
|
|
client_max_body_size 8m;
|
|
|
|
location = /mcp {
|
|
proxy_pass http://127.0.0.1:3000;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_buffering off;
|
|
proxy_cache off;
|
|
proxy_read_timeout 24h;
|
|
proxy_send_timeout 24h;
|
|
}
|
|
|
|
location ^~ /.well-known/ {
|
|
proxy_pass http://127.0.0.1:3000;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_cache off;
|
|
}
|
|
|
|
location ~ ^/(authorize|token|register|revoke)$ {
|
|
proxy_pass http://127.0.0.1:3000;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-For $remote_addr;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_cache off;
|
|
}
|
|
|
|
location = /health {
|
|
proxy_pass http://127.0.0.1:3000/health;
|
|
proxy_set_header Host $host;
|
|
}
|
|
}
|