Nginx configuration Issue

Dewangga Bachrul Alam dewanggaba at xtremenitro.org
Fri Mar 3 09:59:03 UTC 2017


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello!

On 03/03/2017 04:15 PM, abhipower.abhi wrote:
> I am using nginx-1.10.3 as a load balancer. In my architecture, I
> have two servers-
> 
> Hostname - sal15062hkb152, IP Address - 172.15.54.116 Hostname -
> sal15062hkb184, IP Address - 172.15.54.105 I want both should work
> in active-passive mode with nginx. My application is running on
> both servers and client can access my application using URL -
> 
> https://sal15062hkb152/views or https://sal15062hkb184/views
> 
> My nginx.conf is -
> 
> #user  nobody; worker_processes  1;
> 
> #error_log  logs/error.log; #error_log  logs/error.log  notice; 
> #error_log  logs/error.log  info;
> 
> #pid        logs/nginx.pid;
> 
> 
> events { worker_connections  1024; }
> 
> 
> http { include       mime.types; default_type
> application/octet-stream;
> 
> #log_format  main  '$remote_addr - $remote_user [$time_local]
> "$request" ' #                  '$status $body_bytes_sent
> "$http_referer" ' #                  '"$http_user_agent"
> "$http_x_forwarded_for"';
> 
> #access_log  logs/access.log  main;
> 
> sendfile        on; #tcp_nopush     on;
> 
> #keepalive_timeout  0; keepalive_timeout  65;
> 
> #gzip  on;
> 
> server { listen       80; server_name  sal15062hkb152;
> 
> #http://sal15062hkb152/oneview/;
> 
> #charset koi8-r;
> 
> #access_log  logs/host.access.log  main;
> 
> location / { root   html; index  index.html index.htm; }
> 
> #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; #} 
> }
> 
> 
> # another virtual host using mix of IP-, name-, and port-based 
> configuration # #server { #    listen       8000; #    listen
> somename:8080; #    server_name  somename  alias  another.alias;
> 
> #    location / { #        root   html; #        index  index.html
> index.htm; #    } #}
> 
> 
> # HTTPS server # server {
> 
> listen       443 ssl; server_name  sal15062hkb152;
> 
> #ssl_certificate      cert.pem; #ssl_certificate_key  cert.key;
> 
> ssl_certificate       iperspective.crt; ssl_certificate_key
> iperspective.key;
> 
> ssl_session_cache    shared:SSL:1m; ssl_session_timeout  5m;
> 
> ssl_ciphers  HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers  on;
> 

[..]

> location / { root   http://oneview; index  index.html index.htm; }

What do you expect for this directive? root[1] directive should be on
local path, if you want proxying response to another backend. try
using proxy_pass[2].

[1] http://nginx.org/en/docs/http/ngx_http_core_module.html#root
[2] http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass

> }
> 
> }
> 
> I am trying to access https://sal15062hkb152/views but I am getting
> "404 Not Found" in browser. I believe, my nginx.conf file
> configuration is not correct. Please let me know proper
> configuration for my nginx.conf file. Thanks
> 
> Posted at Nginx Forum:
> https://forum.nginx.org/read.php?2,272731,272731#msg-272731
> 
> _______________________________________________ nginx mailing list 
> nginx at nginx.org http://mailman.nginx.org/mailman/listinfo/nginx
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQI4BAEBCAAiBQJYuT5kGxxkZXdhbmdnYWJhQHh0cmVtZW5pdHJvLm9yZwAKCRDl
f9IgoCjNcFnxD/oCSqZG6BLx2+i7qRDlPFtjs65yCc25UYTigT0GEKgzi9Sa9TsJ
wcxnbreOtaZxjG6lM7L890mkZ7xaRCd5hZea4TfaBUKfUESzbCUi9mFQUh4yWhei
RksO+CmYmbGZ1t8EFI+bzw7jJyNYyvsdHpEAjnLBs7NtWogsKMSV9e0G58E/XIts
mfQUc5L0O4XeUL/DSD/+ie3Mx54Wdjw4SHr5XnogNpowvKRYqL76aOvjT0zxBFNX
u1lHnRHR6m2t2dZZGnZ3jNswiZx1JI3P1gDFKHHV9PAZgV3poc6jU4WqvJuZLIDr
2IghYg8c7xwmPnvncNKOr0XNpBpiwyR9KWR3A+cWzGHzNxQJXaLIt55VLJxIP9uF
v99xY6S6ONkRPyVywSWUa6eOr9cc0f0Un8sdqIWLyUcihR0JrTBTtl2Ycu8bR5g9
g8+kQQW6ryP9X79LB9hICoIeXwij4gWC8g7EfVnYmElKkRwp2msuVgc1FGvfW/9o
HT6oBRw0V7JmcCTCVZ7ycmDsl1PdUvWm5/6LvUwlCYzFTyPFl7ZcDuGxF4bknVQM
8eEbwb/HgwLIq1jYc2GStv2WjNdLds9KsPIjggmKxqZPpk3IKMKLhA9BjcCitqsP
93KkxLCHC0SyVREEoX7aG3DOvYyHUrDPNi7t2L6nW9hnwJfHWaLtzS8kAA==
=Ac+6
-----END PGP SIGNATURE-----


More information about the nginx mailing list