codex-frontend/docker/nginx.template

32 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

log_format custom
'$remote_addr - $request_time - [$time_local] - $msec - '
'$request_id - $connection-$connection_requests - '
'$scheme - $host - $server_port - '
'$request_method - $request_uri - $server_protocol - $status - $request_completion - '
'$bytes_sent - $request_length - "$http_referer" - "$http_user_agent" - '
'$proxy_host - "$upstream_addr" - "$upstream_status" - "$upstream_connect_time" - "$upstream_response_time" ';
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
error_page 500 502 503 504 /50x.html;
access_log /var/log/nginx/access.log custom;
client_max_body_size 0;
location / {
try_files $uri /index.html;
add_header Cache-Control "no-cache";
}
location /api {
proxy_pass $codex_url;
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;
}
}