How to use ProxyForge
A practical guide to the five generators: what each setting does, where the output goes on your server, and how to test it before going live.
5-minute walkthrough: an Nginx reverse proxy with a free Let's Encrypt certificate on a real Ubuntu server, using the Config and SSL generators. Watch on YouTube. The video loads from YouTube only when you press play.
Note: at 2:44 the video shows the SSL config with OCSP stapling lines (ssl_stapling). The SSL Generator no longer adds them, because Let's Encrypt stopped supporting OCSP in 2025. Use the current output from the generator instead. Why stapling was removed.
- Before you start
- Server Config Generator
- Redirect Generator
- SSL / Let's Encrypt Generator
- Security Headers Generator
- Basic Protection Generator
- Cloudflare WAF rules that pair with your config
- Testing and reloading safely
- Saving and sharing a config (and building a link)
- Common errors (FAQ)
Before you start
- Pick your server first. Every tool has an Nginx / Apache switch at the top. The output, file name and comments change to match.
- Read the comments in the output. Lines starting with
#tell you where the snippet belongs and which modules it needs. - Back up before you edit. Copy the file you're changing first, for example
sudo cp site.conf site.conf.bak. - Paths vary by distro. Defaults assume Debian/Ubuntu layouts. On RHEL, Alma, Rocky or Fedora some file names and locations differ.
Everything runs in your browser. Nothing you type is sent to a server. The output was tested on real Nginx 1.30 and Apache 2.4 servers during development (not live each time you generate a config).
1. Server Config Generator
Builds a complete site config for a reverse proxy, WordPress, a static site or a PHP-FPM app. To see the full output for each type first, with what was tested, see Nginx config file examples.
Open the Config Generator →Settings
- Apache: .htaccess or Virtual host
- Pick Apache, then choose the output. .htaccess (the default) is for shared hosting or when you can't edit the server config: it can't bind your domain, set up HTTPS or use a real
ProxyPass. Virtual host is for your own server: a complete<VirtualHost>file withServerName, HTTPS with Let's Encrypt paths and HTTP/2, realProxyPasswith the Host header kept, WebSockets (upgrade=websocket, Apache 2.4.47+) and live Cloudflare real-IP lines. The comment at the top lists the modules to enable and where to save the file. Tested on Apache 2.4.68 with real requests through to a backend and PHP-FPM 8.3. There's no upload-size setting for Apache: its default limit is 1 GB (Apache 2.4.54+). If Apache then saysInvalid command 'ProxyPass', a module in the output's “Needs these modules” comment is off: see the Invalid command guide. - What are you configuring?
- Reverse proxy forwards requests to an app server (Node.js, Python, Go and so on). WordPress, Static site and PHP-FPM app serve files from disk, with PHP handled where needed.
- Domain name
- The domain the site answers on, without
https://or a trailing slash, e.g.example.com. - Backend address
- Reverse proxy only: where your app is actually running, e.g.
127.0.0.1:3000. - Max upload size
- Nginx only, for a reverse proxy, WordPress or a PHP-FPM app. Nginx's default is
1m. Raise it if your site accepts larger uploads, otherwise users get a "413 Request Entity Too Large" error. For WordPress and PHP, also raise PHP'supload_max_filesizeandpost_max_size. See Fix 413 Request Entity Too Large. - Site root path
- The folder your site's files live in, e.g.
/var/www/example.com. - PHP-FPM socket
- Where PHP-FPM listens: usually a Unix socket:
unix:/run/php/php8.3-fpm.sockon Debian/Ubuntu (the number matches your PHP version),unix:/run/php-fpm/www.sockon RHEL, Alma and Rocky. Or a TCP address like127.0.0.1:9000. If unsure, check thelistenline in your PHP-FPM pool config. - Redirect HTTP to HTTPS
- Adds the HTTPS server block and a redirect from port 80. It assumes a certificate already exists (see the SSL generator). The port 80 block still answers Let's Encrypt's renewal check at
/.well-known/acme-challenge/(from/var/www/htmlfor a reverse proxy, or your site root otherwise) and redirects everything else, socertbot --webrootrenewals keep working. If you gave Certbot a different-wfolder, change that path, then runsudo certbot renew --dry-runto confirm. In Apache .htaccess mode this box is disabled, because HTTPS is configured in the virtual host, not in .htaccess. - Enable gzip compression
- Compresses text responses (HTML, CSS, JS, JSON) to save bandwidth.
- Support WebSocket connections
- Needed for live reload, sockets or streaming APIs behind a reverse proxy. On Nginx it adds a
map $http_upgrade $connection_upgradeblock above the server block, so theConnectionheader isupgradeonly for real WebSocket requests andcloseotherwise. The map must sit outside any server block; if another site file already defines it, one copy is enough. If the WebSocket still won't open, or drops after a minute, see WebSocket proxy not working. - Behind Cloudflare
- Tick this if the domain is proxied through Cloudflare (orange cloud). On Nginx it adds
set_real_ip_fromlines for Cloudflare's published IP ranges plusreal_ip_header CF-Connecting-IP, so logs and apps see real visitor IPs. On Apache the equivalentmod_remoteiplines are shown as comments, because they must go in the virtual host, not .htaccess. Either way, set Cloudflare's SSL/TLS mode to Full (strict): "Flexible" talks to your server over plain HTTP, so an HTTP-to-HTTPS redirect loops forever (see Fix ERR_TOO_MANY_REDIRECTS behind Cloudflare). Cloudflare's ranges change rarely; the current list is at cloudflare.com/ips. - Older Nginx (before 1.25.1)
- Tick this if
nginx -vshows a version older than 1.25.1, as on Ubuntu 22.04 or Debian 11 packages. The HTTPS block then useslisten 443 ssl http2;instead of the separatehttp2 on;line, which older versions reject. Newer Nginx accepts the old form but prints a deprecation warning, so untick it after upgrading. - Also listen on IPv6 (Nginx)
- Adds
listen [::]:80;and, for HTTPS,listen [::]:443 ssl;next to the IPv4 lines, so visitors on IPv6 reach the same site. Off by default: tick it ifip -6 addrshows a global IPv6 address on the server and your domain has an AAAA record. Tested on Nginx 1.27 and 1.30: each port answers over IPv6 exactly as it does over IPv4, and with IPv6 switched off bysysctlNginx still starts. If IPv6 is disabled in the kernel itself, though, Nginx can refuse to start with these lines, so check it's running after you reload. Apache'sListen 80already covers IPv6 on most systems, so there's no Apache option.
Running WordPress or a PHP app and would rather not manage Nginx and PHP-FPM yourself? Kinsta offers managed WordPress hosting with free migrations, and Cloudways offers managed cloud hosting for WordPress and PHP apps on DigitalOcean, Vultr or AWS (affiliate links).
Where the output goes
Nginx (nginx.conf): save it as its own site file and enable it.
# Debian / Ubuntu
sudo nano /etc/nginx/sites-available/example.com # paste the output
sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
# RHEL / Alma / Rocky / Fedora
sudo nano /etc/nginx/conf.d/example.com.conf
Apache (.htaccess): save it as .htaccess in the site's root folder. Apache only reads it if the virtual host allows overrides (AllowOverride All), and the modules named in the comments must be enabled, e.g. sudo a2enmod rewrite proxy proxy_http on Debian/Ubuntu.
Apache limitation: .htaccess can only proxy through mod_rewrite's [P] flag. Directives like ProxyPass and ProxyPreserveHost aren't allowed there at all. For full proxy control, put the rules in the virtual host config instead.
2. Redirect Generator
Creates correct redirects for the most common moves, including the differences between Nginx and Apache.
Open the Redirect Generator →Settings
- What are you redirecting?
- HTTP → HTTPS, bare domain → www, www → bare domain, old domain → new domain, or a single path → a new URL.
- Domain name / New domain
- Plain domains, no
https://or trailing slash. - Old path
- Must start with a slash and match the URL exactly, e.g.
/old-page. - New URL
- The full destination, including
https://. - Redirect type
- 301 (permanent) is almost always right: browsers and search engines remember it. Use 302 (temporary) only if the move will be undone.
- Apache: .htaccess or Virtual host
- Same choice as the Config Generator. .htaccess (default) suits shared hosting. Virtual host gives complete
<VirtualHost>blocks, including port 443 for www and non-www redirects (which .htaccess can't set up), with Let's Encrypt renewals kept working on port 80. A single-page redirect is oneRedirectline for the site's existing virtual host. Tested on Apache 2.4.68: every redirect type as 301 and 302, query strings kept. - Also listen on IPv6 (Nginx)
- Adds the matching
[::]listen lines to each redirect server block. Same rule as the config generator: tick it if the server has IPv6.
Where the output goes
- Nginx: domain-level redirects are their own
server {}blocks, added next to your existing ones. A single-path redirect is alocationblock that goes inside your existingserver {}(the file is namedlocation-snippet.confto make that clear). - Apache: add the output to the
.htaccesson the site being redirected. For a domain move, that's the old domain's server. - Let's Encrypt renewals: HTTP → HTTPS and domain redirects leave
/.well-known/acme-challenge/alone when the check file exists (Nginx looks in/var/www/html; change it to yourcertbot -wfolder. Apache looks in the folder holding the.htaccess). Anything else is redirected as usual, socertbot --webrootrenewals keep working. Confirm withsudo certbot renew --dry-run. - Certificates: redirecting HTTPS traffic for
wwwor the bare domain still needs a valid certificate for the name being redirected from. The output comments flag this.
Check it worked: curl -I http://example.com should show 301 and the new Location:.
3. SSL / Let's Encrypt Generator
Gives you the Certbot command to get a free certificate, plus the matching Nginx or Apache SSL config.
Open the SSL Generator →Settings
- How is Certbot obtaining the cert?
- Automatic: Certbot edits your web server config for you. Webroot: Certbot only fetches the certificate and you add the config yourself. Standalone: for when no web server is running yet (Certbot briefly runs its own on port 80).
- Webroot path
- Must match the document root your web server already serves this domain from. Certbot renews the same way, so that folder must stay reachable over plain HTTP at
/.well-known/acme-challenge/even after you add an HTTPS redirect. The Config Generator's Nginx HTTPS output includes that exception; with any other redirect, add one yourself and test withsudo certbot renew --dry-run. - Domain(s)
- Comma-separated for several names on one certificate, e.g.
example.com, www.example.com. - Wildcard certificate
- Covers
*.example.com. It requires a DNS-01 challenge (a DNS TXT record), because Certbot can't prove ownership of a wildcard over HTTP. The generated--manualcommand has you add the TXT record by hand, so that certificate won't renew on its own. For a wildcard you keep, use your DNS provider's Certbot plugin (e.g. certbot-dns-cloudflare) so renewals are automatic. - Optional. Let's Encrypt stopped sending expiry reminder emails on 4 June 2025 and no longer keeps the address with your account. Left blank, the command uses
--register-unsafely-without-email. Don't use an example.com address: Let's Encrypt refuses it. The email is deliberately left out of shareable links. - Add HSTS header
- Tells browsers to always use HTTPS for this domain. Only enable it once HTTPS works reliably.
- OCSP stapling (removed)
- The option was removed in November 2026. Let's Encrypt certificates have had no OCSP address since May 2025, so stapling does nothing with them: Nginx prints a warning and Apache logs errors. If an older config still has
ssl_staplingorSSLUseStaplinglines, see this guide. - Older Nginx (before 1.25.1)
- Tick this if
nginx -vshows a version older than 1.25.1, as on Ubuntu 22.04 or Debian 11 packages. The HTTPS block then useslisten 443 ssl http2;instead of the separatehttp2 on;line, which older versions reject. Newer Nginx accepts the old form but prints a deprecation warning, so untick it after upgrading. - Also listen on IPv6 (Nginx)
- Adds
listen [::]:80;and, for HTTPS,listen [::]:443 ssl;next to the IPv4 lines, so visitors on IPv6 reach the same site. Off by default: tick it ifip -6 addrshows a global IPv6 address on the server and your domain has an AAAA record. Tested on Nginx 1.27 and 1.30: each port answers over IPv6 exactly as it does over IPv4, and with IPv6 switched off bysysctlNginx still starts. If IPv6 is disabled in the kernel itself, though, Nginx can refuse to start with these lines, so check it's running after you reload. Apache'sListen 80already covers IPv6 on most systems, so there's no Apache option.
Where the output goes
- Run the Certbot command on the server.
- Nginx: add the SSL lines to your site's
server {}block that listens on 443. - Apache: the output has two parts. The first (
SSLSessionCache) must go once in the main server config (httpd.conforssl.conf), outside any<VirtualHost>. Apache refuses to start if they're inside one. The second part goes inside your<VirtualHost *:443>block. - Get the current cipher line from TLSRef Configurator (choose "Intermediate") and paste it where the output comment says.
Confirm renewals will work: sudo certbot renew --dry-run.
4. Security Headers Generator
Adds the HTTP security headers most sites should send.
Open the Security Headers Generator →Settings
- Strict-Transport-Security (HSTS)
- Forces HTTPS. Include subdomains applies it to every subdomain. Preload adds the flag needed to submit your domain at hstspreload.org. It automatically turns on Include subdomains, which preloading requires. Preloading is hard to undo, so only use it if every subdomain will always be HTTPS.
- X-Frame-Options
- Prevents clickjacking.
DENYblocks all framing.SAMEORIGINlets only your own site frame its pages. - X-Content-Type-Options: nosniff
- Stops browsers guessing file types in ways attackers can exploit. Safe to leave on.
- Referrer-Policy
- Controls how much of your URL is sent to other sites.
strict-origin-when-cross-originis the recommended default. - Permissions-Policy
- Blocks camera, microphone and geolocation access your site almost certainly doesn't use.
- Content-Security-Policy (advanced)
- Off by default. A wrong CSP breaks pages. The presets are starting points: Strict (same-origin only), and Allow Google Fonts. There's no AdSense preset: Google says AdSense only supports a strict CSP with a per-request nonce, not a list of allowed hosts, and a static config can't make a nonce (Google's CSP guide). Test in a browser and watch the console for CSP errors before relying on one.
Where the output goes
- Nginx: inside your
server {}block. Gotcha:add_headerdoesn't inherit into alocationblock that has its ownadd_headerlines, so repeat the headers there too or they silently disappear for those requests. - Apache: inside your
<VirtualHost>or.htaccess. Requiresmod_headers(sudo a2enmod headerson Debian/Ubuntu).
Check them: curl -I https://example.com lists the headers your site sends.
5. Basic Protection Generator
Blocks the automated probes every public server gets: exposed hidden files, leftover backups and known scanner tools, plus an optional rate limit. It's basic protection, not a full WAF. It uses only standard Nginx and Apache features, doesn't inspect requests for SQL injection or XSS, and user-agent blocks are easy to fake. For more, see Cloudflare WAF rules below.
Open the Basic Protection Generator →Settings
- Block hidden files and folders
- Anything whose path starts with a dot:
/.git/config,/.env,/.svn,/.htpasswd./.well-known/is left open on purpose, because Let's Encrypt uses it to renew your certificate. - Block backup and dump files
- Files ending in
.bak,.old,.orig,.save,.swp,.sqlor~. Editors and database tools leave these behind, and they often contain passwords. - Response for blocked files
404(recommended) makes it look like nothing is there.403says it exists but is forbidden.- Block known scanner tools
- Returns
403to requests whose User-Agent names sqlmap, Nikto, Nmap, masscan, ZGrab or Nuclei. It only stops lazy scans; anyone can change their User-Agent. - Hide the server version
- Nginx:
server_tokens off. Apache:ServerTokens ProdplusServerSignature Off. - Rate limit requests per visitor (Nginx)
- Uses
limit_req: visitors over the limit get429 Too Many Requests. A page load can fetch 20–40 files, so keep the whole-site limit generous (the default is 20 a second with a burst of 50). Behind Cloudflare, set up real visitor IPs first with the Config Generator's Behind Cloudflare option, or every visitor shares one limit. Apache has no built-in per-visitor limit, so for Apache use a Cloudflare rate limiting rule instead.
Where the output goes
- Nginx: Part 1 (the
limit_req_zoneline, only with rate limiting) goes once at the top of your site file, outsideserver {}. Part 2 goes insideserver {}. Gotcha: put thelocationblocks above any other regex location likelocation ~ \.php$, because Nginx uses the first regex that matches. - Apache: Part 1 (
ServerTokens) only works in the main config (apache2.conforhttpd.conf). Part 2 goes in your<VirtualHost>or.htaccess. Requiresmod_rewrite(sudo a2enmod rewriteon Debian/Ubuntu).
Check it: curl -I https://example.com/.git/config should return 404 (or 403), and your site should still load.
Cloudflare WAF rules that pair with your config
If your site is behind Cloudflare (orange cloud), its WAF stops bad requests before they reach your server, and the free plan covers the basics. Your server config is still worth having: it protects you if someone reaches your server directly, and if you ever turn Cloudflare off. These rules go in Cloudflare under Security → WAF → Custom rules (the free plan allows 5). Use Edit expression and paste the expression, then choose the action.
1. Block hidden files and folders
Same idea as the generator's option, stopped at Cloudflare's edge. Action: Block.
(starts_with(http.request.uri.path, "/.") and not starts_with(http.request.uri.path, "/.well-known/"))
2. Block common scanner tools
Action: Block. Same limits as on your server: it only catches tools that announce themselves.
(lower(http.user_agent) contains "sqlmap") or (lower(http.user_agent) contains "nikto") or (lower(http.user_agent) contains "nuclei") or (lower(http.user_agent) contains "zgrab") or (lower(http.user_agent) contains "masscan")
3. Block WordPress probes (only if you don't run WordPress)
Most scanner traffic looks for WordPress login pages. If your site isn't WordPress, block them. Action: Block. Don't use this on a WordPress site.
(http.request.uri.path contains "/wp-login.php") or (http.request.uri.path contains "/xmlrpc.php") or (http.request.uri.path contains "/wp-admin")
4. Rate limit a login page
Under Security → WAF → Rate limiting rules. The free plan allows one rule, counting by IP over 10 seconds and blocking for 10 seconds. Example: match URI Path equals /login (or /wp-login.php), and block when an IP sends more than 10 requests in 10 seconds. This is also the rate limit to use with Apache.
Two things that make Cloudflare rules actually work
- Real visitor IPs on your server. Behind Cloudflare, your logs and Nginx rate limits see Cloudflare's IPs unless you restore the real ones. The Config Generator's Behind Cloudflare option adds this.
- Only accept traffic from Cloudflare. If attackers find your server's real IP, they can skip Cloudflare entirely. Allow ports 80 and 443 only from Cloudflare's IP ranges in your firewall or hosting panel.
Check a rule is working under Security → Events, which lists every request it blocked. Free plans also include Cloudflare's own Free Managed Ruleset and Bot Fight Mode, which you can switch on under Security.
Testing and reloading safely
Always test the config before reloading. A reload with a broken config can take your site down.
# Nginx
sudo nginx -t && sudo systemctl reload nginx
# Apache (Debian / Ubuntu)
sudo apachectl configtest && sudo systemctl reload apache2
# Apache (RHEL / Alma / Rocky / Fedora)
sudo apachectl configtest && sudo systemctl reload httpd
The && means the reload only happens if the test passes. If the test fails, the error names the file and line. Fix it, or restore your backup.
Saving and sharing a config
Your settings are stored in the page address after the #. That means:
- Refreshing the page or using the back button keeps your settings.
- You can bookmark a config, or send the link to a colleague and they'll see exactly the same output.
- The part after
#is never sent to any server. The SSL generator deliberately leaves your email out of the link.
Building a link to a ready-made config
You can also write these links by hand, in documentation or a script, or ask an AI assistant to build one. The link opens the generator with your settings already filled in, and you still see the full config and its notes before you copy anything.
Add settings after the # as name=value pairs joined with &. Anything you leave out keeps its default. If a value isn't valid, the page shows a warning and uses the example value instead.
Server Config Generator (/)
servernginxorapacheapachevhostfor the Apache virtual host output (leave it out for .htaccess)appTypeproxy,wordpress,staticorphpfpmdomain,backend,root,sock,maxbody- The same values you'd type in the form, e.g.
backend=127.0.0.1:3000,maxbody=10m ssl,gzip,ws,cf,old,v6- Add
=1to tick HTTPS redirect, gzip, WebSocket support, Behind Cloudflare, Older Nginx or IPv6. Leave them out to keep them off.
https://proxyforge.tech/#server=nginx&appType=proxy&domain=example.com&backend=127.0.0.1:3000&ssl=1&ws=1
Redirect Generator (/redirect-generator)
servernginxorapacheapachevhostfor the Apache virtual host output (leave it out for .htaccess)redirectTypehttps,www,nonwww,domainorpathdomain,newdomain,oldpath,newurl- The same values you'd type in the form
status301(permanent) or302(temporary)v6- Add
=1to also listen on IPv6 (Nginx only)
https://proxyforge.tech/redirect-generator#server=apache&redirectType=www&domain=example.com&status=301
SSL / Let's Encrypt Generator (/ssl-generator)
servernginxorapachemethodplugin,webrootorstandalonedomains,webroot- Domains separated by commas, e.g.
domains=example.com,www.example.com, and the webroot folder wildcard,hsts,old,v6- Add
=1to turn each one on. Leave them out to keep them off.
https://proxyforge.tech/ssl-generator#server=nginx&method=webroot&webroot=/var/www/example.com&domains=example.com,www.example.com&hsts=1
Your email can't be set from a link, on purpose.
Security Headers Generator (/security-headers-generator)
servernginxorapachehsts,subdomains,preload,nosniff,camera,mic,geo1for on or0for offframeDENY,SAMEORIGINornonereferrerstrict-origin-when-cross-origin,no-referrer,same-origin,strict-origin,no-referrer-when-downgradeornonecspnone,strictorfonts
https://proxyforge.tech/security-headers-generator#server=nginx&hsts=1&subdomains=1&preload=0&frame=SAMEORIGIN&csp=none
Common errors
Seeing unknown directive "http2", a failed Let's Encrypt renewal, ProxyPass refused in .htaccess or a Cloudflare redirect loop? The FAQ: common errors page has a direct fix for each.
Questions or a wrong result?
If a generated config doesn't work on your distro or setup, or you'd like another generator, email admin@proxyforge.tech.
FAQ: common errors · Guides · What's new · About · Featured On · Privacy