nginx userdir.conf configuration example for Red Hat Enterprise Linux Server 7 (Maipo)

Get the default configuration file userdir.conf for nginx, optimized for Red Hat Enterprise Linux Server 7 (Maipo). This example configuration ensures optimal compatibility and performance for nginx, making it easy to set up and adjust to meet your needs.

Find and download the configuration file here: /etc/httpd/conf.d/userdir.conf.

For more configurations and setup guides, visit our related files section to further customize your system.

    #
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid.  This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    UserDir disabled

    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disabled" line above, and uncomment
    # the following line instead:
    # 
    #UserDir public_html
</IfModule>

#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/public_html">
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>


    
  

Config Details

Location
/etc/httpd/conf.d/userdir.conf
Operating system
Red Hat Enterprise Linux Server 7 (Maipo)
Length
36 lines
MD5 checksum
d4a2620683cc3ff2315c685f9f354265

Usage

Download the raw file with wget or curl

Wget

wget -O userdir.conf.example https://exampleconfig.com/static/raw/nginx/rhel7/etc/httpd/conf.d/userdir.conf

cURL

curl https://exampleconfig.com/static/raw/nginx/rhel7/etc/httpd/conf.d/userdir.conf > userdir.conf.example