The original poster, sat, wants to block access to their Discourse forum until it’s ready, but allow access to a specific IP address for their team to work on content. codinghorror suggests running the setup wizard to make the instance private, but sat notes that this requires users to log in to see content.
pfaffman and merefield offer alternative solutions, suggesting the use of iptables or nginx rules to limit access by IP. sat ultimately finds a solution by creating a whitelist IP file in the nginx configuration, which allows access to the forum from a specific IP address while blocking all others.
Here are the steps to achieve this:
Create a file whitelist-ip.conf in the /etc/nginx/ folder with the allow and deny all directives.
Add the include /etc/nginx/whitelist-ip.conf; line to the /etc/nginx/conf.d/discourse.conf file.
Test the nginx configuration and reload the service.
Note that pfaffman mentions that these changes will be lost when the container is rebuilt.
I would like to block access to my discourse forum until it is ready but would like to have access to only few IP address so that our team can work on forum.
I do know below options can be enable but I want my team to see forum like regular user until it is ready and work on content.
settings->login
Public registration is disabled, all new users must be explicitly invited by trusted users or staff.
Require authentication to read content on this site, disallow anonymous access.
When outside user(non approved IP address) visit my site they should see nothing there.
If you use the setup wizard that launches after first install, you can select a private instance in one of the first steps. If you need to re-run the wizard you can do so at /wizard
Easy. Set forum to private as Jeff suggests and then approve access to only your setup team. If you don’t approve others they will only see the login screen. You can set permissions to categories by group if you need further granularity.
You don’t like the discourse solution, so it’s a sysadmin issue. You can Google stuff like “block ip with iptables” or ‘limit ip access nginx". You might try’ “ufw” instead of iptables.
If you have a budget I might be able to help. My contact info is in my profile.