Switch feedback reverse proxy from IIS to NGINX
- Add nginx-wp-suite.conf: static site + /api/feedback proxy to the Power Automate trigger (SNI on, Host header, POST-only, body cap) - Remove IIS web.config - Update feedback-config.js comment and DEPLOYMENT.md to the NGINX setup Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
56
nginx-wp-suite.conf
Normal file
56
nginx-wp-suite.conf
Normal file
@@ -0,0 +1,56 @@
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
# Work Package Suite — NGINX site config
|
||||
#
|
||||
# Serves the static site and reverse-proxies feedback to a Power Automate
|
||||
# "When an HTTP request is received" trigger. The browser only ever sees the
|
||||
# same-origin path /api/feedback, so there is NO CORS and the secret trigger URL
|
||||
# (with its sig= token) never reaches client code.
|
||||
#
|
||||
# Install:
|
||||
# 1. Copy the project files to the web root (e.g. /var/www/wp-suite).
|
||||
# 2. Put this file at /etc/nginx/conf.d/wp-suite.conf
|
||||
# (or /etc/nginx/sites-available/ + symlink into sites-enabled/).
|
||||
# 3. Replace server_name, the ssl_certificate paths, and the proxy_pass URL.
|
||||
# 4. sudo nginx -t && sudo systemctl reload nginx
|
||||
# ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
# Redirect plain HTTP to HTTPS
|
||||
server {
|
||||
listen 80;
|
||||
server_name wp-suite.company.local; # <-- your internal hostname
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name wp-suite.company.local; # <-- your internal hostname
|
||||
|
||||
# Internal certificate from your company CA
|
||||
ssl_certificate /etc/nginx/ssl/wp-suite.crt; # <-- cert path
|
||||
ssl_certificate_key /etc/nginx/ssl/wp-suite.key; # <-- key path
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
|
||||
# Static site
|
||||
root /var/www/wp-suite; # <-- web root
|
||||
index index.html;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ =404;
|
||||
}
|
||||
|
||||
# ── Feedback proxy → Power Automate ──────────────────────────────────────
|
||||
# Paste your real trigger URL into proxy_pass below, keeping the FULL query
|
||||
# string (api-version, sp, sv, sig). A small body cap keeps this endpoint safe.
|
||||
location = /api/feedback {
|
||||
limit_except POST { deny all; } # only accept POST
|
||||
client_max_body_size 256k;
|
||||
|
||||
proxy_pass https://prod-XX.westus.logic.azure.com/workflows/REPLACE_WORKFLOW_ID/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=REPLACE_SIGNATURE;
|
||||
|
||||
proxy_http_version 1.1;
|
||||
proxy_ssl_server_name on; # SNI — required for *.logic.azure.com
|
||||
proxy_set_header Host prod-XX.westus.logic.azure.com; # <-- match your region host
|
||||
proxy_set_header Content-Type application/json;
|
||||
proxy_set_header Cookie ""; # don't leak site cookies upstream
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user