72 lines
2.5 KiB
Plaintext
72 lines
2.5 KiB
Plaintext
# Dedicated Petstore server blocks. Replace domains/certificate paths before use.
|
|
# Keep these blocks separate from Gitea/GitLab configurations on a shared host.
|
|
|
|
# Deliberately log $uri instead of $request_uri/$request so report and invitation
|
|
# tokens carried in query strings never enter Nginx access logs.
|
|
log_format petstore_safe '$remote_addr - $remote_user [$time_local] '
|
|
'"$request_method $uri $server_protocol" $status $body_bytes_sent '
|
|
'"$http_referer" "$http_user_agent"';
|
|
|
|
upstream petstore_backend_8080 {
|
|
server 127.0.0.1:8080;
|
|
keepalive 16;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name api.petstore.invalid;
|
|
ssl_certificate /etc/letsencrypt/live/api.petstore.invalid/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/api.petstore.invalid/privkey.pem;
|
|
|
|
client_max_body_size 200m;
|
|
access_log /var/log/nginx/petstore-api.access.log petstore_safe;
|
|
|
|
location / {
|
|
proxy_pass http://petstore_backend_8080;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_connect_timeout 10s;
|
|
proxy_send_timeout 300s;
|
|
proxy_read_timeout 300s;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name admin.petstore.invalid;
|
|
root /opt/petstore/admin/current;
|
|
index index.html;
|
|
ssl_certificate /etc/letsencrypt/live/admin.petstore.invalid/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/admin.petstore.invalid/privkey.pem;
|
|
access_log /var/log/nginx/petstore-admin.access.log petstore_safe;
|
|
|
|
location /api/ {
|
|
proxy_pass http://petstore_backend_8080;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
location /uploads/ {
|
|
proxy_pass http://petstore_backend_8080;
|
|
}
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name report.petstore.invalid;
|
|
root /opt/petstore/frontend-h5/current;
|
|
index index.html;
|
|
ssl_certificate /etc/letsencrypt/live/report.petstore.invalid/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/report.petstore.invalid/privkey.pem;
|
|
access_log /var/log/nginx/petstore-report.access.log petstore_safe;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
}
|