Files
contracts-flask/deploy/nginx-contracts-upload.conf
T
RepinoidandCopilot bb5dd6538e
Deploy contracts-flask / validate (push) Canceled after 0s
Fix Contracts upload buffer endpoint
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-30 12:08:55 +03:00

51 lines
1.5 KiB
Plaintext

# Dedicated WebDAV upload buffer for Contracts on VM213.
# Install as /etc/nginx/sites-enabled/contracts-upload.conf.
# sites-enabled is included from Nginx's http context, where map is valid.
map $http_origin $contracts_upload_cors_origin {
default "";
~^https://contractor\.pythonk8s\.dev\.nubes\.ru$ $http_origin;
}
server {
listen 80;
server_name contracts-upload.sinefo.ru;
location /.well-known/acme-challenge/ {
root /var/www/acme;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name contracts-upload.sinefo.ru;
ssl_certificate /etc/letsencrypt/live/contracts-upload.sinefo.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/contracts-upload.sinefo.ru/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
# Match the app's 50 MiB per-file limit; uploads are raw PUT bodies.
client_max_body_size 50m;
location /contracts-upload/ {
alias /var/www/contracts-upload/;
dav_methods PUT DELETE;
create_full_put_path on;
client_max_body_size 50m;
add_header Access-Control-Allow-Origin $contracts_upload_cors_origin always;
add_header Access-Control-Allow-Methods "PUT, GET, OPTIONS, DELETE" always;
add_header Access-Control-Allow-Headers "Content-Type" always;
add_header Access-Control-Max-Age 86400 always;
if ($request_method = OPTIONS) { return 204; }
}
location / {
return 404;
}
}