Setup Solr Admin web interface in Nginx

This article will guide on setting up Solr Admin web interface in Nginx. If you haven't installed Solr in your system, please check this article Step by step guide to setup Apache Solr 5.x in CentOS 7 for Drupal 7 Panopoly distro using Search API. Please follow this guide if you haven't setup your Nginx yet.

  1. Create a domain for Solr, in this guide lets use Go to DNS manager and add "solr" as A record for

  2. Now, lets create nginx configuration for

    vi /etc/nginx/sites-available/admin/

    ... and have the following script as its content:

    server {
      listen XXX.XXX.XXX.XXX:80; # IPv4
      listen [XXXX:XXXX::XXXX:XXXX:XXXX:XXXX]:80; # IPv6
      location / {
        auth_basic "Restricted";
        auth_basic_user_file /etc/nginx/key/.htpasswd-users;

    Note: Change the XXX.XXX.XXX.XXX and XXXX:XXXX::XXXX:XXXX:XXXX:XXX with your server's IPv4 and IPv6 addresses respectively.

  3. Create symbolic link for in /etc/nginx/sites-enabled/ to enable this configuration:

    ln -s /etc/nginx/sites-available/admin/ /etc/nginx/sites-enabled/
  4. Add password protection to

    htpasswd /etc/nginx/key/.htpasswd-users admin

    This command will prompt password for the new user with the name admin.

  5. Restart nginx:

    systemctl restart nginx
  6. You can now access your Solr Admin web interface at and this should challenge you with password.


Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.