NGINX Reverse Proxy My Installation Experiance

Before Troubleshooting what I have the plan to test
1) http80 multiple locations check 80 webservers (working fine)
1.1) add SSL certificate - (working fine) 
1.2) try rewrite option test it - (checked but not working fine)
2)http80 root location work 443 web server add SSL(automatically redirect hero into https)
3)read man page for nginx.conf and default.conf to get any information related to SSL and multiple locations - Not preset
4) read error log access log slowly and understand and take action related to that - (Not that much helpful)
5) search in the forum first read everything carefully and note down the possible solution and try it. - (I have read it, But, I don't have time to implement everything what I have studied)

NOTE
1)always enter with https://hostname2/
PROBLEM
Assumption 1)only ssl dynamic site is not working with multiple locations. So we need to concentrate on the rewrite rule.
Real Solution: it is not related to the rewrite. After properly configured the proxy_pass then the dynamic site is working fine. And the previous configuration also while checking
https://hostname2/2017 is redirected to https://hostname2/pbsworks/index.jsp (when I am changing this into https://hostname2/2017/pbsworks/" it is working.
1)Finally problem, I have change proxy_pass URL from proxy_pass http://hostname1:8086 to  proxy_pass http://hostname1:8086/pbsworks;Then it is resolved
2)if I have added anything extra like slash / at the end proxy_pass http://hostname1:8086/pbsworks/ that is also causing the error.
So to resolve this kind of issue, we have to do the things like machine learning - carefully study the system behavior and do the next step.
For Better Troubleshooting
1)20/80 rules is trial and error method. (without implement anything just study you can't understand directly). Basic things for the configuration do the testing.
1)Plan the activity with a proper checklist and carefully test the application behavior.
2)once test everything make everything simple.
3)if need better video record your troubleshooting. so anything if you miss you can get it back.

Why time is wasted too much.
1)lot of time spend on a) rewrite rules and b) ssl parameter and c) read access log/error log.. d)Don't have clear idea whether https backend site will work without work SSL configuration
a)rewrite -> to confirm this just write the small rewrite rules and test it how it behave
b)SSL parameter , d) Don't have clear idea whether https backend site will work without work SSL configuration 
.-> it will work, but in your case, it is not working reason is it is dynamic URL not static. So you have to try static http site. then you can confirm.
c)read access /error log -> Definitely we need to read the log.
But from the log -> google answer I didn't get any fruitful solution. 

it is working fine on / root directory not working on multiple locations 
And the previous configuration also while checking location /2017
proxy_pass http://hostname1:8086 -> I am getting 404 access
proxy_pass http://hostname1:8086/ -> I am getting https://hostname2/pbsworks/index.jsp ->(page is not display) I manually enter https://hostname2/2017/pbsworks/index.jsp-> working fine.
proxy_pass http://hostname1:8086/pbsworks; -> Then it is working without any glitch.
Why I didn't concentrate on this - location /
proxy_pass http://hostname1:8086/; -> https://hostname2/ working fine.So I believe there is no problem at the proxy_pass. But the problem lies only on the proxy_pass only.
2)next thing rather than trying on browser and cache problem. better we can try on the curl or elinks easy way to try it.
3)whenever we are trying the new option and functionality (study what it is doing and implement it) - Then only we know their characteristics.

Solution
1)final solution has been found in simple and straightforward. 
Rather than document/Video experienced person help into the right way - bala.(That is a reasonable experience play very vital role)
Smart work
1)Take enough quality time work without any pressure.(before anyone gives pressure we need to complete in advance).
2)Take some gap while working continuously so that, you can recall what you did and plan what you are going to do.

Post a Comment

0 Comments