i'm trying to use nginx as proxy for my apache all vhosts. i've set up a config file at
/etc/nginx/sites-available/mydomain
and i'also created sym link by using a command
ln -s /etc/nginx/sites-available/mydomain /etc/nginx/sites-enabled/mydomain
the config file is
server {
listen 80;
root /home/mydomain/public_html;
index index.php index.html index.htm;
server_name mydomain.com www.mydomain.com;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host:80;
proxy_pass 192.168.1.104:8080;
}
location ~ /\.ht {
deny all;
}
}
i also change the Apache to listen 8080 and set the vhost to
then i had restarted the nginx and apache, but finally when i visit http://www.mydomain.com , it displays
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
it seems the nginx was not successfully applied the vhosts file. Any ideas?
nginx -t
. I see, you've missed protocol inproxy_pass
.