Welcome! Log In Create A New Profile

Advanced

how to redirect to Apache2 properly

Posted by fstefanov 
how to redirect to Apache2 properly
January 31, 2018 09:39PM
I'm running Nginx Tomcat Apache2 Kibana Grok and Graphite on single server.

tomcat serves grok apache2 serves graphite nginx listen on port 80 and redirect.

My configuration is:

server {

listen 443 ssl default_server;
listen 80;

if ($scheme = http) {
return 301 https://$server_name$request_uri;
}

server_name myserver.org;
if ($http_x_forwarded_proto = '') {
set $http_x_forwarded_proto $scheme;
}

root /var/www/html/;

location / {
alias /var/lib/tomcat8/webapps/;
proxy_pass http://127.0.0.1:4180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_connect_timeout 5;
proxy_send_timeout 30;
proxy_read_timeout 30;
}

location /kibana/ {
proxy_ignore_client_abort on;
proxy_pass http://localhost:5601/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
}


location /graphite/ {
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 $scheme;
proxy_pass http://localhost:81/;
}
}

Requests to localhost/kibana/ work fine.
Requests to localhost/graphite/ are served by tomcat instead of apache2.
If i go to localhost:81 my graphite is loaded.
What is wrong here?
Re: how to redirect to Apache2 properly
February 01, 2018 01:50AM
localhost/graphite/ returns

HTTP Status 404 - /browser/header/

message /browser/header/
HTTP Status 404 - /composer/
type Status report
message /composer/
description The requested resource is not available.
Apache Tomcat/8.0.32 (Ubuntu)

this is from apache2 log when i call it directly on localhost:81

"GET /content/js/completer.js HTTP/1.1" 200 1010 "http://:81/composer/?"
"GET /content/js/ext/ext-all.js HTTP/1.1" 200 198092 "http://:81/composer/?"
"GET /render HTTP/1.1" 200 1178 "http://:81/composer/?"
"GET /render/?width=586&height=308&_salt=1517449.194 HTTP/1.1" 200 1418 "http://:81/composer/?"

And this is when i go through nginx localhost/graphite/

"GET / HTTP/1.0" 200 764 "-" "Mozilla/5.0
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 239
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