Skip to main content

allow another ip / domain to use nginx reverse proxy to cpanel hosted website

Comments

4 comments

  • vanessa
    Re: allow anoter ip / domain to use nginx reverse proxy to cpanel hosted website Make sure that whatever IP nginx is directing the traffic to is the same IP configured for the site within Apache.
    0
  • cPanelMichael
    Hello :) Typically, in cases where the default website appears, it's because the access attempt is over an IP address the VirtualHost is not setup with. Make sure the domain name is assigned the same IP address it's pointed to. Thank you.
    0
  • rebornishard
    [quote="vanessa, post: 1691891">Make sure that whatever IP nginx is directing the traffic to is the same IP configured for the site within Apache.
    hello vanessa, thanks to reply i want to caching it, so it get the page once then show it on another server [quote="cPanelMichael, post: 1692212">Hello :) Typically, in cases where the default website appears, it's because the access attempt is over an IP address the VirtualHost is not setup with. Make sure the domain name is assigned the same IP address it's pointed to. Thank you.
    hello michael, thanks to reply yes i point it to domain, is there something wrong with my conf ? here my config : location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { access_log off; log_not_found off; expires max; } location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://domain.com; } location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } location ~ /\. { deny all; } location ~* /(?:uploads|files)/.*\.php$ { deny all; } try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$;
    thank you
    0
  • cPanelMichael
    I don't see anything wrong with the configuration itself, but note that it falls outside cPanel's scope of support. You may want to consult with a qualified system administrator for assistance with this type of setup. Thank you.
    0

Please sign in to leave a comment.