mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #280] Use nginx-proxy-manager as web server #248
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#248
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @callebridholm on GitHub (Jan 26, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/280
Hi,
I recently used apache2 at my Debian device as web server. Then I found this thing that helped my to publish several thing on other machines in my local network with SSL to the web. To still be able to publish things at my local machine I earlier use apache2 directly for I now use nginx-proxy-manager and point to localhost:8080 (I change port for apache2). is it possible to just replace apache2 with nginx-proxy-manager directly as the only webserver? I have problem with one application hosted on the same machine as nginx-proxy-manager when it act as proxy for apache2. I found that you can specify some local folders but still you need to point to some ip address somehow.
@jc21 commented on GitHub (Jan 27, 2020):
Yep so you're requesting a Static site configuration and NPM doesn't support that yet. I'll keep this in mind when planning for the next major version.
@callebridholm commented on GitHub (Jan 28, 2020):
Yes for example I want to replace a vhost in Apache2 pointing to /var/www/mysite/ with this proxy if possible to not need to run two web servers at the same machine.
@ikomhoog commented on GitHub (Apr 10, 2020):
i did this a while ago, didnt know it should be impossible so nothing stopped me.
i added an environment path: /websites : /mnt/user/appdata/NginxProxyManager/websites
i set the details to 1.1.1.1:1 because i had to fill in everything.
and set the advance thing to
location / {
root /websites;
}
and then you get set it to a subdomain (websites for example), and just use it like websites.XXXXXX.com/index.html and the html page will show up
@neojp commented on GitHub (Oct 21, 2020):
@jc21 I would love to see this feature built-in. I will help if you have any pointers on how you would like to see this done.
@ikomhoog This worked for me. Thanks for the workaround!
@fuzsh commented on GitHub (Oct 31, 2020):
complete @ikomhoog answer, thanks to @ikomhoog . 👍
/opt/websites:/mnt/user/appdata/NginxProxyManager/websitesdocker-compose up -d@Jacob-Lasky commented on GitHub (Nov 5, 2020):
@FaRzad-845 - Thanks for your input, I've been able to get it running however the CSS/JS on the site fails to load.
If I were to load the .html file, then everything is loaded without any problems.
However, when going to the site's URL, the only thing I see is the html site. Are there additional steps to getting the CSS and JS working?
@fuzsh commented on GitHub (Nov 6, 2020):
@Jacob-Lasky i use above snippet for react app and everything is okay. can you give more details on what exactly you do ?
@nandhakumargdr commented on GitHub (Mar 2, 2021):
Working for me, and how to apply the SSL certificate?
@ikomhoog commented on GitHub (Mar 2, 2021):
@nandhakumargdr for me the SSL certificate just works like for a normal proxy, via the SSL tab of the nginx-proxy-manager "New/Edit Proxy Host" screen.
@ikomhoog commented on GitHub (Mar 2, 2021):
as an update to the earlier config, I now use a shorter method(still the same steps as before, just a shorter version under the advance tab):
this redirects mydomain.com to portfolio.mydomain.com but if I use mydomain.com/index.html it will return /websites/index.html
This is also useful if you want to download a file since it will just return the file instead of only returning index.html.
@flinkazoid commented on GitHub (Mar 5, 2021):
So Im trying to migrate my SWAG setup over to this tool, its much easier to start up a proxy.
I'm having a hard time following exactly what goes where to get this working as a simple webserver for my static webpages I'm hosting.
How do I fill out the entire Details tab?
How do I fill out the entire Custom location tab and what is it signifying?
@ikomhoog commented on GitHub (Mar 5, 2021):
In the details tab you just fill in a subdomain, random ip and random port.
This is because it has to be filled in in order to save the proxy.
I don't actually know the custom location tab, i haven't tried it, i always leave it blank.
I fill in the advanced tab with nginx config code.
@DanielZsk commented on GitHub (Mar 16, 2021):
I cant get it to work, especially the advance section underlines some parts in red and doesnt allow me to save it. Im a rook, any more pointers you could give me? Thanks in advance
My volumes:
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
- ./localdirstaticcontent/publish/wwwroot:/mnt/user/appdata/NginxProxyManager/websites
@ikomhoog commented on GitHub (Mar 16, 2021):
these are my volumes:
I made Websites share for this.
I gave nginx a new path named /websites Whereas you have given it '/mnt/user/appdata/NginxProxyManager/websites'
Now if you want to refer to that folder you have to use '/mnt/user/appdata/NginxProxyManager/websites' where I can use /websites.
So it might be better to just change it to the same for simplicity(not an expert so there might be something wrong with this)
I dont get red lines when typing in the advance section and even when putting in garbage text i can still save it.
It wont work ofcourse and shows the proxy as "offline" with a red dot instead of a green one.
But that shouldnt be the issue
Did you follow the earlier steps of filling in the first tab "details" where it asks the domain names, IP and Port? just fill in a random IP/Port just because you cannot save if you miss these.
Also just for an update to my earlier guide thingy:
/websites : /mnt/user/appdata/NginxProxyManager/websites1.1.1.1:1for this example.test.txtinto the directory you assigned at step 1, this is/mnt/user/appdata/NginxProxyManager/websitesin my example.I hope this helps
@DanielZsk commented on GitHub (Mar 16, 2021):
You are a gentleman! I owe you a biertje. Im new to this topic and you taking the time to break it down into simple steps helps me tremendously.
An interesting tidbit I have found, in case someone else has the same issue with SPAs:
I tried to make the above work with a single page app (Blazor, however applies for ReactJs as well), Nginx's route always overwrote the router of the apps, therefore I kept receiving an error if I didnt start at /index.html. However, the solution is to force all requests through the index page, hence forcing them to go through the js router of the framework. You need to add: "try_files $uri $uri/ /index.html" .
I could not add this in the advanced tab for some reason, it was underlined and wouldn't let me save it, however if you manually add the line into the datavolume/nginx/proxy_host/1.conf, it works like magic! No idea why it wont let me add this line in the GUI though...my file now looks like (not sure if this will persist, however it should as long as the volume is kept):
------------------------------------------------------------
localhost
------------------------------------------------------------
server {
set $forward_scheme http;
set $server "1.1.1.1";
set $port 80;
listen 80;
listen [::]:80;
server_name localhost;
access_log /data/logs/proxy_host-1.log proxy;
location / {
root /websites;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
@Jacob-Lasky commented on GitHub (Mar 17, 2021):
@FaRzad-845 - apologies for such a huge delay. Your instructions here worked great for me, with one change.
I needed to make sure that "cache assets" was turned off. Otherwise, I cannot load the CSS for some reason.
Thanks for this snipped!
@jepcd commented on GitHub (Mar 25, 2021):
Thanks! this works although I'm unable to get the force ssl option to work when doing so.
EDIT: I was able to get force ssl to work by changing some stuff:
This seems to be working so far.
@jithinsisaac commented on GitHub (Apr 28, 2021):
This is how i sorted this out, might not be the best option:
Installed & ran apache2 web server to listen to port 8081 instead of port 80, Then went to NPM and made a reverse proxy for xyz.domain.com to point to IP:8081. It works well for a single static site!
Can someone help if i want to do a virtual host thing? i.e. multiple websites to be opened up via single reverse proxy.
I have not understood the solution given over here, would be grateful if someone can help with screenshots!
@chaptergy commented on GitHub (May 11, 2021):
Duplicate of https://github.com/jc21/nginx-proxy-manager/issues/58
@Casal0x commented on GitHub (Aug 26, 2022):
i tryed everything still getting 403 without
try_files $uri /index.html /index.html;with this line i'm getting 500 any help pls@farzad-845 @jc21
@Jacob-Lasky commented on GitHub (Aug 26, 2022):
@Casal0x
The minimum lines I needed in the advanced section are the following:
As long as you have an index.html within the folder you're pointing to then you should be good.
I use the NginxProxyManager in UnRAID through docker and these are my settings

Just make sure that your container can see the folder you're using, and I haven't had problems with removing
try_filesLet me know if this works.
@SP3NGL3R commented on GitHub (Jan 10, 2023):
This worked 99% perfectly for me too. Thank you. I opted for "nginx-static" instead of 1.1.1.1, just so it is a bit more self descriptive. But it still works. Now my problem is when I go to sub.site.com/folder/ it doesn't load the index.htm from the folder. It works at "/", just not at "/folder/". Any ideas there? I've tried a few things but they all don't work and I can't figure it out from the NGINX documentation. --thanks for the easy solution