-
Notifications
You must be signed in to change notification settings - Fork 36
Add document "How to set up an application proxy in Nginx?" #408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
poespas
merged 5 commits into
master
from
Add-document-How-to-set-up-an-application-proxy-in-Nginx
Dec 22, 2025
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d6c12a6
Add document "How to set up an application proxy in Nginx?"
7cb6347
Use proper syntax highlighting, omit console command for reading out …
6c975f9
Merge branch 'master' into Add-document-How-to-set-up-an-application-…
poespas 3525b77
Change prompt from myapp to example
6543557
Merge branch 'master' into Add-document-How-to-set-up-an-application-…
poespas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
docs/hypernode-platform/nginx/how-to-set-up-an-application-proxy-nginx.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| myst: | ||
| html_meta: | ||
| description: Learn how to set up an Nginx application proxy on Hypernode using Managed Vhosts: create a proxy vhost and point it to your app | ||
| title: How to set up an application proxy in Nginx? | Hypernode | ||
| --- | ||
|
|
||
| # How to Set Up an Application Proxy in Nginx | ||
|
|
||
| Sometimes you want to serve an application that listens on a local port (for example a Node, Python or PHP service on `localhost:3000`) behind a friendly domain on your Hypernode. Instead of writing a custom Nginx config, you can use Hypernode Managed Vhosts to generate a ready‑made proxy vhost coniguration and then just point it to your application. This keeps your configuration simple and consistent with the rest of your setup. | ||
|
|
||
| ## Create a proxy vhost | ||
|
|
||
| Create a new vhost and set its type to `proxy`. In the example below we create a vhost for `proxy.myapp.hypernode.io`: | ||
|
|
||
| ```bash | ||
| app@abc123-myapp-magweb-cmbl:~$ hmv proxy.myapp.hypernode.io --type proxy | ||
| INFO: Managing configs for proxy.myapp.hypernode.io | ||
| INFO: No existing config for proxy.myapp.hypernode.io, starting with default options | ||
| INFO: Writing HTTP config for proxy.myapp.hypernode.io | ||
| ``` | ||
|
|
||
| This command creates a vhost directory under `/data/web/nginx/<your-domain>/` with the proxy templates. You will see the following files: | ||
|
|
||
| ```bash | ||
| app@abc123-myapp-magweb-cmbl:~/nginx/proxy.myapp.hypernode.io$ ls | ||
poespas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| public.proxy.conf server.rewrites.conf staging.proxy.conf | ||
| ``` | ||
|
|
||
| ## Point the proxy to your application | ||
|
|
||
| Open `public.proxy.conf`. The only lines you normally need to change are at the top: the upstream host and port your application listens on. By default they point to `localhost:3000`. | ||
|
|
||
| ```nginx | ||
| app@abc123-app-magweb-cmbl:~/nginx/proxy.myapp.hypernode.io$ cat public.proxy.conf | ||
poespas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| set $app_proxy_host localhost; | ||
| set $app_proxy_port 3000; | ||
|
|
||
| root /data/web/public; | ||
|
|
||
| include /etc/nginx/app_proxy_handler.conf; | ||
|
|
||
| location / { | ||
| echo_exec @app_proxy_handler; | ||
| } | ||
| ``` | ||
|
|
||
| Replace `localhost` and `3000` with the correct target for your app if it listens elsewhere. You generally do not need to change anything below those two lines. The included `app_proxy_handler.conf` wires up sensible proxy defaults, SSL, headers and buffering for you. Save the file and Nginx will apply the change. | ||
|
|
||
| If you also plan to use the staging mode of this vhost, mirror the same host and port settings in `staging.proxy.conf` so that the staging switch serves the same upstream. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.