Ubuntu Web Server with Nginx

Started on the old forum in March 2017 · view the original in the archive · old links redirect here

#hosting #php #ubuntu

No replies · 66 views · started 9 years ago · 1 min read

ztmcoder21 Newbie · 1 posts #1
I am creating a website on an ubuntu server using nginx. I set it up so that when you go to it is ask for a user name and password. I used this command: sudo htpasswd -c /etc/nginx/.htpasswd username I then ran this command to make changes to this file: sudo gedit /etc/nginx/sites-enabled/default The files looks like this: server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html; index index.php index.html index.htm; server_name (put IP address here); # Change this to your FQDN. location /munki_repo/ { alias /usr/local/munki_repo/; autoindex off; auth_basic "Restricted"; auth_basic_user_file /etc/nginx/.htpasswd; } } So after doing that and and of course setting up the files/directories. When I go to ipaddress/munki_repo in the web browser and enter the correct username and password it gives me the following error: 403 Forbidden nginx/1.4.6 (Ubuntu) Any ideas as to what I am doing wrong? this is the first time I have used nginx?

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close