2025-03-23 18:09:52 -05:00

50 lines
1.5 KiB
Plaintext

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name localhost;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
# # S3 proxy example
# location /s3/ {
# # Remove the /s3/ prefix when forwarding to S3
# rewrite ^/s3/(.*)$ /$1 break;
# proxy_http_version 1.1;
# proxy_set_header Host $s3_bucket.s3.amazonaws.com;
# proxy_set_header Authorization "";
# proxy_hide_header x-amz-id-2;
# proxy_hide_header x-amz-request-id;
# proxy_hide_header Set-Cookie;
# proxy_ignore_headers "Set-Cookie";
# proxy_buffering off;
# proxy_intercept_errors on;
# # Add AWS authentication headers
# aws_auth access=$aws_access_key secret=$aws_secret_key region=$s3_region;
# # S3 endpoint - modify for your region if needed
# proxy_pass https://$s3_bucket.s3.amazonaws.com/;
# }
# # Example of a Lua endpoint
# location /lua {
# default_type 'text/plain';
# content_by_lua_block {
# ngx.say("Hello from Lua!")
# ngx.say("S3 Bucket: " .. os.getenv("S3_BUCKET"))
# ngx.say("S3 Region: " .. os.getenv("S3_REGION"))
# }
# }
# Error pages
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}