Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: ERROR USING NGINX AS REVERSE PROXY

$
0
0
Hi,
Thanks for the reply. I changed the location and NGINX worked but only on the local server. Every time i used it on an external host it gave me an error 404. The working code for the local host is posted below

upstream myapp1 {
server www.becpsn.com;

server {
listen 80;
server_name localhost;

#charset koi8-r;

#access_log logs/host.access.log main;

#location {
# root html;
# index index.html index.htm;

location /test {

proxy_pass http:/<local host>/example.png;

}

#error_page 404 /404.html;

# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html
{
root html;
}

# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>