Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a server running nginx + php5-fpm with a wordpress installation. My website is served on example.com and I would like to configure admin.example.com to point my site contributors to example.com/wp-admin. How do I configure my server{} block to do this?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

I believe something like this should work:

server {
    server_name  admin.example.com;
    rewrite ^(.*) http://example.com/wp-admin permanent;
}
share|improve this answer
    
edit: removing the completely false statement I made in this comment. This worked. –  Wade Tandy Nov 15 '10 at 6:07
    
There's no point in a capture you're not using. rewrite ^ http... would work just fine –  Martin Fjordvald Nov 15 '10 at 8:16
add comment

Try this:

    location / {
        root   /home/kiputih0/public_html;
        index  index.php;
        try_files $uri $uri/ /index.php?q=$uri&$args;
    }

In my permalinks I've custom rules: /%year%/%monthnum%/%day%/%postname%.html

And when I browse to some article it will be:

/2010/11/15/beta.html

Cheers...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.