Apache VirtualHost Generator
Generate an Apache VirtualHost with a proxy pass and HTTPS redirect in your browser.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Generated an Apache VirtualHost for example.com with 15 line(s).
How it works
- Wrote the VirtualHost opening line and server identity.
- Set the document root and proxy pass directives.
- Added the mod_rewrite HTTP→HTTPS redirect.
- The proxy directives require mod_proxy and mod_proxy_http; the redirect requires mod_rewrite.
- Run `apachectl configtest` yourself before reloading Apache.
Methodology
- Validate the server name, optional admin email, document root and upstream.
- Emit the VirtualHost with ServerName, DocumentRoot and proxy directives.
- Prepend the mod_rewrite redirect only when requested.
Usage
- Enter the server name, document root and proxy upstream.
- Optionally add an admin email and enable the HTTPS redirect.
- Copy the block into your Apache site configuration.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
Reverse proxy with HTTPS redirect
{
"serverName": "example.com",
"serverAdmin": "admin@example.com",
"documentRoot": "/var/www/example",
"upstream": "http://backend:3000",
"redirectHttp": true
}Limitations
What the generated block assumes
The VirtualHost listens on `*:80`, sets `ServerName` and `DocumentRoot`, forwards to the upstream with `ProxyPass`/`ProxyPassReverse`, and adds a rewrite rule when the redirect is enabled.
Frequently asked questions
- Why are there no SSL directives?
- The generated block listens on port 80 and redirects to HTTPS; a TLS listener belongs in a separate `<VirtualHost *:443>` with your certificate paths.
- Does ProxyPass need a trailing slash?
- Yes; the generator appends one so `/` maps to the upstream root.
Sources
- Apache VirtualHost examples — Apache Software Foundation
- mod_proxy documentation — Apache Software Foundation
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.