# example of an http/https server configuration for forwarding requests to umh
server {
listen 80;
listen 443 ssl;
server_tokens off;
# Add CORS headers globally for this server
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow-Methods' 'POST,GET,HEAD,OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'content-type' always;
# Handle OPTIONS requests
if ($request_method = 'OPTIONS') {
return 204;
}
location /example/route/ {
# docker exposes the service `umh` as a hostname
# the port is an example for an http_input that has to be created in umh
proxy_pass http://umh:8285;
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;
}
}