Welcome! Log In Create A New Profile

Advanced

nginx reverse proxy with ssl terminator and upstream

Posted by ripplingwater75 
nginx reverse proxy with ssl terminator and upstream
April 08, 2017 07:58AM
I use nginx as a SSL termination reverse proxy with upstream. The upstream points to my couchbase server installation that can be accessed without any problem directly (without using nginx ssl reverse proxy). But once I do it through nginx then only I see a lot of errors in my console because none of the assets (js/css and other files) get loaded and I see a lot of errors in my chrome console. I have researched and tried a lot of things these last 2 days but nothing seems to work. As for the SSL cert itself, it is correctly installed and I even get an A+ on qualys. I have attached both the nginx conf and the error log. Any pointers will greatly help. Thanks

nginx.conf (removed the irrevelant stuff from the conf)

user nginx;
worker_processes 2;

worker_rlimit_nofile 100000;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;

include /usr/share/nginx/modules/*.conf;

events {
use epoll;
worker_connections 1024;
multi_accept on;
}

http {
upstream couchbaseserver {
server 127.0.0.1:8091 max_fails=0;
}

server {
access_log /var/log/nginx/access.log main buffer=32k;
error_log /var/log/nginx/error.log error;
expires max;

# Listen on both 443 for the main connections and 80 for streaming container data
listen 80;
listen 443 ssl;

server_name sub.example.com;

add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;

ssl on;

ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;

# Force initial HTTP requests to switch to HTTPS:
if ($ssl_protocol = "") {
rewrite ^ https://$host:443$request_uri? permanent;
}

location / {
proxy_pass http://couchbaseserver;
proxy_redirect off;
proxy_set_header Host $host ;
proxy_set_header X-Real-IP $remote_addr ;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for ;
proxy_set_header X-Forwarded-Proto https;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_cache_bypass $http_upgrade;

proxy_connect_timeout 10;
proxy_send_timeout 10;
proxy_read_timeout 10;
proxy_buffer_size 4k;
proxy_buffers 4 32k;
proxy_busy_buffers_size 64k;
proxy_temp_file_write_size 64k;
proxy_temp_path /var/cache/nginx_proxy_temp;
}

}
}

error.log (in /var/log/nginx/error.log)

2017/04/08 11:25:35 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static/lib/prism.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static/lib/prism.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:36 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static/js/expvar.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static/js/expvar.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:36 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static/js/index.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static/js/index.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:36 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static/js/query.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static/js/query.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:37 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static/js/b64.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static/js/b64.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:37 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static/js/filters.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static/js/filters.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:37 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static/js/directives.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static/js/directives.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:37 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static-bleve-mapping/js/mapping/index-mapping.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static-bleve-mapping/js/mapping/index-mapping.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:38 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static-bleve-mapping/js/mapping/type-mapping.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static-bleve-mapping/js/mapping/type-mapping.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:38 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static-bleve-mapping/js/mapping/analysis.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static-bleve-mapping/js/mapping/analysis.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:38 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static-bleve-mapping/js/mapping/analysis-analyzer.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static-bleve-mapping/js/mapping/analysis-analyzer.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:39 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static-bleve-mapping/js/mapping/analysis-wordlist.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static-bleve-mapping/js/mapping/analysis-wordlist.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:39 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static-bleve-mapping/js/mapping/analysis-charfilter.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static-bleve-mapping/js/mapping/analysis-charfilter.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:39 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static-bleve-mapping/js/mapping/analysis-tokenizer.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static-bleve-mapping/js/mapping/analysis-tokenizer.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:40 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/static-bleve-mapping/js/mapping/analysis-tokenfilter.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/static-bleve-mapping/js/mapping/analysis-tokenfilter.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:40 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/js/debug.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/js/debug.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"
2017/04/08 11:25:40 [error] 3862#0: *363 open() "/usr/share/nginx/html/_p/ui/fts/fts.js" failed (2: No such file or directory), client: 192.168.255.40, server: sub.example.com, request: "GET /_p/ui/fts/fts.js HTTP/1.1", host: "sub.example.com", referrer: "https://sub.example.com/ui/index.html"

Thanks once again
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 254
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready