H
Homarrโ€ข2y ago
Deleted User

setup homarr with nginx

hi everyone newbie here on deploying homarr.... i deployed homarr with docker compose as told on the guide but i want to use homarr with nginx can someone guide me how to do it ? thanks in advance
73 Replies
Manicraft1001
Manicraft1001โ€ข2y ago
Hello, @amirulandalib . First off, we need some context what you want to do. We can't help you if we don't know your goal. Can you explain it to us? (example: I want to expose Homarr to XYZ using XYZ)
Deleted User
Deleted UserOPโ€ข2y ago
sure i want to expose homarr to the domain radarr.amirulandalib.eu.org by default i am running homarr on docker on port 4426 now it is 0.0.0.0:4426
Manicraft1001
Manicraft1001โ€ข2y ago
In this case, you only need a simple proxy host with certificate then Setup with Homarr will be no different compared to your other services
Deleted User
Deleted UserOPโ€ข2y ago
huh? i want to configure nginx with homarr and other apps which will be redirected with homarr and ask for authentication eg: homarr.amirulandalib.eu.org/qbittorrent/ homarr.amirulandalib.eu.org/plex homarr.amirulandalib.eu.org/radarr etc i can manage certificate but how to configure with nginx if you kindly guide me nginx currently running on port 80
Manicraft1001
Manicraft1001โ€ข2y ago
But you didn't tell me that before ๐Ÿ˜… If you want authentication, you can either use the password environment variable of Homarr or use an authentication proxy like Authelia So you want me to tell you, how you need to configure your proxy, so you can host your Homarr unrelated apps?
Deleted User
Deleted UserOPโ€ข2y ago
no no how to configure like this . the homepage is homarr.amirulandalib.eu.org other apps from the dashboard when tapped on eg qbittorrent will go to homarr.amirulandalib.eu.org/qbittorrent
Manicraft1001
Manicraft1001โ€ข2y ago
Ok. So when homarr.amirulandalib.eu.org is already going to Homarr, then you need to overwrite your desired routes. Example:
server {
...
location /qbittorrent {
...
}
location /plex {
...
}
}
server {
...
location /qbittorrent {
...
}
location /plex {
...
}
}
So homarr.amirulandalib.eu.org/qbittorrent will trigger the location selector and homarr.amirulandalib.eu.org/plex will trigger the second selector
Deleted User
Deleted UserOPโ€ข2y ago
but how to put homarr to the config i just told you my plan but dont know how to put it to conf
Manicraft1001
Manicraft1001โ€ข2y ago
If homarr.amirulandalib.eu.org should go to Homarr, then your location is / Example:
// this is your Homarr
location / {

}
// this is your Homarr
location / {

}
Deleted User
Deleted UserOPโ€ข2y ago
i have to port local server ip and port for redirection i can share you ssh conn
Manicraft1001
Manicraft1001โ€ข2y ago
No. Never do that
Deleted User
Deleted UserOPโ€ข2y ago
need help dude i suffered a lot from swizzin
Manicraft1001
Manicraft1001โ€ข2y ago
You seem to lack general knowledge about reverse proxies. I'd recommend you to read a guide for initial configuration. I think you're asking for proxy_pass, but I'm not sure. Also note, that authentication will make your setup more complex and requires some additional knowledge You can use proxy_pass like this: proxy_pass 192.168.5.XXX
Deleted User
Deleted UserOPโ€ข2y ago
http://150.136.251.212:8081/ (currently it is like this)
sudo nano /etc/nginx/apps/qbittorrent-vpn.conf
# /etc/nginx/apps/qbittorrent-vpn.conf

location /qbittorrentvpn {
return 301 /qbittorrentvpn/;
}

location /qbittorrentvpn/ {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $http_host;
http2_push_preload on; # Enable http2 push
auth_basic "What's the password?";
auth_basic_user_file /etc/htpasswd.d/htpasswd.yourusername;
rewrite ^/qbittorrentvpn/(.*) /$1 break;
proxy_cookie_path / "/qbittorrentvpn/; Secure";
}
sudo nano /etc/nginx/apps/qbittorrent-vpn.conf
# /etc/nginx/apps/qbittorrent-vpn.conf

location /qbittorrentvpn {
return 301 /qbittorrentvpn/;
}

location /qbittorrentvpn/ {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $http_host;
http2_push_preload on; # Enable http2 push
auth_basic "What's the password?";
auth_basic_user_file /etc/htpasswd.d/htpasswd.yourusername;
rewrite ^/qbittorrentvpn/(.*) /$1 break;
proxy_cookie_path / "/qbittorrentvpn/; Secure";
}
Manicraft1001
Manicraft1001โ€ข2y ago
Then you need proxy_pass http://150.136.251.212:8081/
Deleted User
Deleted UserOPโ€ข2y ago
something like this
Deleted User
Deleted UserOPโ€ข2y ago
GitHub
reverse-proxy-confs/dashy.subdomain.conf.sample at master ยท linuxse...
These confs are pulled into our SWAG image: https://github.com/linuxserver/docker-swag - reverse-proxy-confs/dashy.subdomain.conf.sample at master ยท linuxserver/reverse-proxy-confs
Deleted User
Deleted UserOPโ€ข2y ago
@manicraft1001
Manicraft1001
Manicraft1001โ€ข2y ago
If we go of this configuration, you simply add
location / {
proxy_pass http://150.136.251.212:8081/
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $http_host;
}
location / {
proxy_pass http://150.136.251.212:8081/
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $http_host;
}
Deleted User
Deleted UserOPโ€ข2y ago
something like this for homarr .
Manicraft1001
Manicraft1001โ€ข2y ago
Yes. I saw your link If you look at the configuration there, it is even documented what I just told you
Deleted User
Deleted UserOPโ€ข2y ago
what about asking for basic auth credentials when directly accessing
Manicraft1001
Manicraft1001โ€ข2y ago
There is even configuration for Authelia Look at the config you sent me 2 minutes ago. Basic Auth is already present there for other routes
Deleted User
Deleted UserOPโ€ข2y ago
this is copypasted from swizzin docs i dont have much knowledge about nginx
Manicraft1001
Manicraft1001โ€ข2y ago
It is clearly documented there with easy and quick explanation what you need to do Instead of doing it for /api though, do it for /
Deleted User
Deleted UserOPโ€ข2y ago
i still dont get it ๐Ÿ˜ฆ sorry 1st step is to configure to route 0.0.0.0:8081 to homarr.amirulandalib.eu.org with nginx
Manicraft1001
Manicraft1001โ€ข2y ago
What do you not get? Creating a file doesn't seem like a hard task
Deleted User
Deleted UserOPโ€ข2y ago
to which dir
/etc/nginx/apps
/etc/nginx/apps
?
Manicraft1001
Manicraft1001โ€ข2y ago
Whatever dir you like. The file will simply store your credentials If you use docker, it's advised that you use a mounted directory - otherwise, you'll loose your passwords after a restart
Deleted User
Deleted UserOPโ€ข2y ago
not docker
Manicraft1001
Manicraft1001โ€ข2y ago
Then, simply create it where you normally create such files?
Deleted User
Deleted UserOPโ€ข2y ago
aight let me try
Manicraft1001
Manicraft1001โ€ข2y ago
You seem to lack quite basic knowledge about some important stuff. Perhaps it would make sense to choose a more basic and easy approach? Running nginx directly can be quite demanding. Have you heard of https://nginxproxymanager.com/ ? It uses nginx under the hood but it offers a comprehensive web interface for configuration and is much easier to use, if you don't know nginx.
Nginx Proxy Manager
Docker container and built in Web Application for managing Nginx proxy hosts with a simple, powerful interface, providing free SSL support via Let's Encrypt
Manicraft1001
Manicraft1001โ€ข2y ago
It is important to understand what's going on and how your actions affect your system. Nginx can have a steep learning curve for some and maybe this would be better for you?
Deleted User
Deleted UserOPโ€ข2y ago
thanks
Manicraft1001
Manicraft1001โ€ข2y ago
btw, this is an example config for what you've requested:
location / {
proxy_pass http://150.136.251.212:8081/
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $http_host;
auth_basic: "Enter the password";
auth_basic_user_file /mnt/user/appdata/nginx/homarr/htpasswd;
}
location / {
proxy_pass http://150.136.251.212:8081/
proxy_http_version 1.1;
proxy_set_header X-Forwarded-Host $http_host;
auth_basic: "Enter the password";
auth_basic_user_file /mnt/user/appdata/nginx/homarr/htpasswd;
}
I hope this clears it up a bit. I highly recommend you to watch / read a few basic tutorials about Nginx so you understand what's going on.
Deleted User
Deleted UserOPโ€ข2y ago
thanks a lot for now i exposed the ip http://150.136.251.212:8081/ but it will be
127.0.0.1:8081
127.0.0.1:8081
then it will redirect to http://150.136.251.212 right? then i will add A name to cloudflares connected domain and use letsencrypt
Manicraft1001
Manicraft1001โ€ข2y ago
If Homarr is running on the same machine as Nginx and runs on port 8081, yes.
Deleted User
Deleted UserOPโ€ข2y ago
yep same machine shall i remove nginx from local
Manicraft1001
Manicraft1001โ€ข2y ago
local?
Deleted User
Deleted UserOPโ€ข2y ago
yes apt remove nginx -y ? then run the nginx manager on docker compose?
Manicraft1001
Manicraft1001โ€ข2y ago
Uhmm I'm not sure about removing Nginx
Deleted User
Deleted UserOPโ€ข2y ago
ok lemme test
Manicraft1001
Manicraft1001โ€ข2y ago
Just adhere to the documentation There should be an uninstallation guide as well Yes, sounds good
Deleted User
Deleted UserOPโ€ข2y ago
ok @manicraft1001 u there?
Manicraft1001
Manicraft1001โ€ข2y ago
Yes?
Deleted User
Deleted UserOPโ€ข2y ago
i am having a small prob
Deleted User
Deleted UserOPโ€ข2y ago
Deleted User
Deleted UserOPโ€ข2y ago
it doesnt work tried the followings bruh i am tired
Manicraft1001
Manicraft1001โ€ข2y ago
- Your IP is probably incorrect. You told me that Homarr is running on http://150.136.251.212:8081/ but you have an entire different subnet there. - I'm not sure how Nginx Proxy Manager will react to IPs in your "Domain names" field. I'd recommend to do some research there
Deleted User
Deleted UserOPโ€ข2y ago
that is external public ip i am using interal ip
Deleted User
Deleted UserOPโ€ข2y ago
Manicraft1001
Manicraft1001โ€ข2y ago
Bad Gateway generally means, that the proxy cannot proxy your request to the target, because the target is either invalid or rejects your request You need to figure this out yourself. This has nothing to do anymore with Homarr ๐Ÿ™‚ Just don't give up. Networking can often be quite tiring but it will be worth the effort!
Deleted User
Deleted UserOPโ€ข2y ago
bruh how many ips will i try 0.0.0.0 localhost internal ip 127.0.0.1 whatelse?
Manicraft1001
Manicraft1001โ€ข2y ago
You probably should avoid 127.0.0.1 I don't know Oracle - I never had good experience with their products Are you using virtual networks?
Deleted User
Deleted UserOPโ€ข2y ago
its nothing to do with oracle vcn?
Manicraft1001
Manicraft1001โ€ข2y ago
Probably not. I'm just saying that I have no experience with it lol
Deleted User
Deleted UserOPโ€ข2y ago
since its a docker to docker app
Deleted User
Deleted UserOPโ€ข2y ago
Deleted User
Deleted UserOPโ€ข2y ago
help plsssss lol even tried nmap and tuln same shit
Deleted User
Deleted UserOPโ€ข2y ago
Deleted User
Deleted UserOPโ€ข2y ago
ports and open and working
Manicraft1001
Manicraft1001โ€ข2y ago
I told you already, that I will not help you with networking. For a proper investigation, there is too much context missing. Please try to investigate the problem yourself. This server only focuses on support for our product - Homarr. If you have any questions about proxies, that relate with Homarr, I'll do my best to help you out.
Deleted User
Deleted UserOPโ€ข2y ago
anyone pro here? lol what a funny thing
Manicraft1001
Manicraft1001โ€ข2y ago
?
Deleted User
Deleted UserOPโ€ข2y ago
Deleted User
Deleted UserOPโ€ข2y ago
this was hard to find atleast works now it looks for docker names to connect to ports lmao
Manicraft1001
Manicraft1001โ€ข2y ago
Yes, this works as long as Docker runs on the same machine as the proxy
Deleted User
Deleted UserOPโ€ข2y ago
is this ok @manicraft1001
Deleted User
Deleted UserOPโ€ข2y ago
Manicraft1001
Manicraft1001โ€ข2y ago
How should I know??
Deleted User
Deleted UserOPโ€ข2y ago
i mean for routing through i will use this option right?
Want results from more Discord servers?
Add your server