Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
18.7 Legacy Series
»
Host small webserver on opnSense / add lighttpd vhost?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Host small webserver on opnSense / add lighttpd vhost? (Read 4517 times)
coldtech
Newbie
Posts: 3
Karma: 0
Host small webserver on opnSense / add lighttpd vhost?
«
on:
October 11, 2018, 02:38:49 pm »
Hey everyone,
I just recently started setting up an opnSense installation and am in the process of migrating my openwrt settings. One of the things I did on my openwrt router was having lighttpd installed which just hosts a single webpage on port 83 - which I forwarded locally in the firewall so that users accessing my public IP address on port 80 will be shown this single page.
Is it possible to do this with opnsense using vhosts (or any other method)? I'm assuming yes, since opnsense already runs lighttpd for the GUI, but because of that the existing lighttpd config is rather intimidating. I just don't know the steps and where to start. So to summaroize what I would like to do:
- host a single webpage on the opnsense machine
- make it accessible from the outside
- all of that without making the management GUI accessible from the outside or mess up the management GUI in any way
Did anyone already do this? I don't want to set up up a separate machine just for this single page...
Any help would be appreciated!
Logged
mimugmail
Hero Member
Posts: 6766
Karma: 494
Re: Host small webserver on opnSense / add lighttpd vhost?
«
Reply #1 on:
October 11, 2018, 03:00:06 pm »
Did you try Nginx Plugin?
Logged
WWW:
www.routerperformance.net
Support plans:
https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German):
https://opnsense.max-it.de/
fabian
Hero Member
Posts: 2769
Karma: 200
OPNsense Contributor (Language, VPN, Proxy, etc.)
Re: Host small webserver on opnSense / add lighttpd vhost?
«
Reply #2 on:
October 11, 2018, 06:38:19 pm »
In depends on your expectations. The nginx plugin offers static + PHP content directly from the FW but no Java EE, Ruby on Rails etc. and currently no official database support (OPNsense comes with sqlite).
Logged
coldtech
Newbie
Posts: 3
Karma: 0
Re: Host small webserver on opnSense / add lighttpd vhost?
«
Reply #3 on:
October 11, 2018, 07:02:28 pm »
Quote from: mimugmail on October 11, 2018, 03:00:06 pm
Did you try Nginx Plugin?
Thanks, I will give that a try - much appreciated!
Logged
coldtech
Newbie
Posts: 3
Karma: 0
Re: Host small webserver on opnSense / add lighttpd vhost?
«
Reply #4 on:
October 11, 2018, 10:48:12 pm »
Quote from: mimugmail on October 11, 2018, 03:00:06 pm
Did you try Nginx Plugin?
So I got it working in a way - at least the website is being displayed when accessing the firewall from the internal network (I chose port 83 for nginx).
But for the life of me I can not figure out how to forward external requests for port 80 to port 83 internally.
Here's what I did:
- changed the management GUI settings to only listen on the LAN interface
- created a NAT port forwarding roule on interface WAN, ptotocol TCP, source address any, source port any, destination address WAN, destination port 80, redirect to the opensense internal IP on port 83
...but it does not work this way. I had this running on openWRT before, so I'm not exactly new to the principles involved, but it seems that there's something I'm missing.
edit: everything was correct, but I needed to set NAT reflection: Enable - now it works
«
Last Edit: October 11, 2018, 10:57:07 pm by coldtech
»
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
18.7 Legacy Series
»
Host small webserver on opnSense / add lighttpd vhost?