[PR #558] [MERGED] Static site hosting and location functionality #3264

Closed
opened 2026-02-26 07:38:40 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/NginxProxyManager/nginx-proxy-manager/pull/558
Author: @lopugit
Created: 8/14/2020
Status: Merged
Merged: 9/3/2020
Merged by: @jc21

Base: static-contentHead: develop


📝 Commits (5)

📊 Changes

16 files changed (+197 additions, -35 deletions)

View changed files

📝 backend/migrations/20180618015850_initial.js (+3 -0)
📝 backend/schema/definitions.json (+5 -0)
📝 backend/schema/endpoints/proxy-hosts.json (+51 -9)
📝 backend/templates/_listen.conf (+5 -0)
📝 backend/templates/_location.conf (+12 -5)
📝 backend/templates/default.conf (+1 -0)
📝 backend/templates/proxy_host.conf (+8 -2)
📝 frontend/js/app/nginx/proxy/form.ejs (+26 -5)
📝 frontend/js/app/nginx/proxy/form.js (+19 -1)
📝 frontend/js/app/nginx/proxy/list/item.ejs (+7 -1)
📝 frontend/js/app/nginx/proxy/location-item.ejs (+27 -6)
📝 frontend/js/app/nginx/proxy/location.js (+14 -3)
📝 frontend/js/i18n/messages.json (+3 -0)
📝 frontend/js/models/proxy-host-location.js (+5 -2)
📝 frontend/js/models/proxy-host.js (+4 -1)
scripts/restart-dev (+7 -0)

📄 Description

I made some modifications to the proxy hosts flow which adds a static toggle which switches between proxying and static root/alias/try_files based locations.

I've modified the base proxy_hosts form and the locations one so you can mix and match between proxy hosts and locations and static hosts and locations.

There's a little bug because I'm not so experienced with Backbone marionette and I used the static toggle to change the required fields on the form from forward_host and forward_ip to index_file and root_dir. And to rerender the form to show that update I ran a this.render call which seems to break the location items rendering so you have to save the root config for a proxy host before clicking edit again to do the locations.

Here's an album of visual changes

https://imgur.com/a/qgxzYFu

You can see the template changes in _location.conf _listen.conf and proxy_host.conf

I had some trouble with the booleans either being 0 or 1, because in the listen forms the model values are used but in the proxy_host form the actual HTML form values are used which is integer on the checkbox's.

I think this pull request will open up nginx proxy manager to a lot more people, as SSL static hosting is one of the most sought after things on the web.

Needs a bit of polishing but that's why I pulled it into the develop branch.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/NginxProxyManager/nginx-proxy-manager/pull/558 **Author:** [@lopugit](https://github.com/lopugit) **Created:** 8/14/2020 **Status:** ✅ Merged **Merged:** 9/3/2020 **Merged by:** [@jc21](https://github.com/jc21) **Base:** `static-content` ← **Head:** `develop` --- ### 📝 Commits (5) - [`d276381`](https://github.com/NginxProxyManager/nginx-proxy-manager/commit/d276381577804527ededf3aecf9ce5da8ba438bb) Added a restart dev script which destroys then starts dev - [`1c302c6`](https://github.com/NginxProxyManager/nginx-proxy-manager/commit/1c302c68428c8c7814b08b8a493a2c0bc977b5da) Backend schema and migration modifications for allowing static hosts and locations - [`37cb63b`](https://github.com/NginxProxyManager/nginx-proxy-manager/commit/37cb63b2d4cd72a11ea5d7fa134172a92904ef84) Frontend form and marionette modifications to allow static hosts and locations - [`19f75dc`](https://github.com/NginxProxyManager/nginx-proxy-manager/commit/19f75dce5ceae624130c87a9afcaef632ca2e8ff) Merge branch 'master' into develop - [`ab0d4ad`](https://github.com/NginxProxyManager/nginx-proxy-manager/commit/ab0d4ad8ac58acb58a44b4fe8120c11a55008f7d) Merge branch 'develop' of https://github.com/lopugit/nginx-proxy-manager into develop ### 📊 Changes **16 files changed** (+197 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `backend/migrations/20180618015850_initial.js` (+3 -0) 📝 `backend/schema/definitions.json` (+5 -0) 📝 `backend/schema/endpoints/proxy-hosts.json` (+51 -9) 📝 `backend/templates/_listen.conf` (+5 -0) 📝 `backend/templates/_location.conf` (+12 -5) 📝 `backend/templates/default.conf` (+1 -0) 📝 `backend/templates/proxy_host.conf` (+8 -2) 📝 `frontend/js/app/nginx/proxy/form.ejs` (+26 -5) 📝 `frontend/js/app/nginx/proxy/form.js` (+19 -1) 📝 `frontend/js/app/nginx/proxy/list/item.ejs` (+7 -1) 📝 `frontend/js/app/nginx/proxy/location-item.ejs` (+27 -6) 📝 `frontend/js/app/nginx/proxy/location.js` (+14 -3) 📝 `frontend/js/i18n/messages.json` (+3 -0) 📝 `frontend/js/models/proxy-host-location.js` (+5 -2) 📝 `frontend/js/models/proxy-host.js` (+4 -1) ➕ `scripts/restart-dev` (+7 -0) </details> ### 📄 Description I made some modifications to the proxy hosts flow which adds a static toggle which switches between proxying and static root/alias/try_files based locations. I've modified the base proxy_hosts form and the locations one so you can mix and match between proxy hosts and locations and static hosts and locations. There's a little bug because I'm not so experienced with Backbone marionette and I used the static toggle to change the required fields on the form from forward_host and forward_ip to index_file and root_dir. And to rerender the form to show that update I ran a this.render call which seems to break the location items rendering so you have to save the root config for a proxy host before clicking edit again to do the locations. Here's an album of visual changes https://imgur.com/a/qgxzYFu You can see the template changes in `_location.conf` `_listen.conf` and `proxy_host.conf` I had some trouble with the booleans either being 0 or 1, because in the listen forms the model values are used but in the proxy_host form the actual HTML form values are used which is integer on the checkbox's. I think this pull request will open up nginx proxy manager to a lot more people, as SSL static hosting is one of the most sought after things on the web. Needs a bit of polishing but that's why I pulled it into the develop branch. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-26 07:38:40 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#3264
No description provided.