bgibson
bgibson

Reputation: 19155

Changed /usr/share/nginx/html/ softlink, now nginx won't serve it @localhost

I use nginx (1.2.4 on Ubuntu 12.04 x64 desktop) to preview frontend designs I'm working on, and something unusual just started happening

The design I was working on was originally located in:

~/Projects/Clients/ANS/src/MetroBusiness.ans

That was softlinked to nginx's localhost directory:

/usr/share/nginx/html/dev/MetroBusiness.ans

And I could view the site at http://localhost/dev/MetroBusiness.ans.

But the problem started after I cleaned up my home directory structure and moved the src directory to ~/work:

~/work/clients/ans/src/MetroBusiness.ans

And re-linked it in nginx's localhost directory:

/usr/share/nginx/html/dev/MetroBusiness.ans

But now I can't view the site in localhost. It should be the same url, but now I'm getting:

Welcome to nginx! If you see this page, the nginx web server is successfully installed and working.

However, the other soft-linked sites that I didn't change still work fine, just the one I changed and re-linked.

Also, it doesn't show up in the nginx directory listing (with other sites linked in the same way, but not recently moved)

I made sure permissions were set to rwxrwxr_x on the moved src directory with chmod -R, restarted nginx, even restarted the computer, but no luck.

I'm sure there's something minor I'm missing, but drawing a blank now. Any idea why Nginx can't see this soft link anymore?

Upvotes: 0

Views: 521

Answers (1)

PhearOfRayne
PhearOfRayne

Reputation: 5050

I've had this happen before and all I needed to do was delete the link and reset it again.

rm /usr/share/nginx/html/dev/MetroBusiness.ans

and then set it again:

ln -s ~/work/clients/ans/src/MetroBusiness.ans /usr/share/nginx/html/dev/MetroBusiness.ans

and check if you were successful:

ls -l /usr/share/nginx/html/dev/

Upvotes: 1

Related Questions