###前提・実現したいこと
http://hiromode.hatenablog.com/entry/2016/11/09/151039を参考に,
Apache(80番ポートでListen)→nginx(8080番ポートでListen)→Mattermost(8065番ポートでListen)を実現しようとしています.
###該当のソースコード
/etc/httpd/conf.d/mattermost.conf
<IfModule mod_proxy.c> ProxyRequests off ProxyPass /mattermost http://localhost:8080/mattermost ProxyPassReverse /mattermost http://localhost:8080/mattermost </IfModule>
/etc/nginx/conf.d/default.conf
upstream backend { server 127.0.0.1:8065; } proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off; server { listen 8080; server_name localhost; location /api/v3/users/websocket { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; client_max_body_size 50M; proxy_set_header Host $http_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_set_header X-Frame-Options SAMEORIGIN; proxy_buffers 256 16k; proxy_buffer_size 16k; proxy_read_timeout 600s; proxy_pass http://localhost:8065; } location / { client_max_body_size 50M; proxy_set_header Connection ""; proxy_set_header Host $http_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_set_header X-Frame-Options SAMEORIGIN; proxy_buffers 256 16k; proxy_buffer_size 16k; proxy_read_timeout 600s; proxy_cache mattermost_cache; proxy_cache_revalidate on; proxy_cache_min_uses 2; proxy_cache_use_stale timeout; proxy_cache_lock on; proxy_pass http://localhost:8065; } }
###試したこと
$curl http://localhost/mattermost
を実行すると
$curl http://localhost:8080
または
$curl http://localhost:8065
と同じ結果が返ってきます.
<!DOCTYPE html> <html> <head> <meta http-equiv=X-UA-Compatible content="IE=edge"> <meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"> <meta name=robots content="noindex, nofollow"> <meta name=referrer content=no-referrer> <title>Mattermost</title> <meta name=apple-mobile-web-app-capable content=yes> <meta name=apple-mobile-web-app-status-bar-style content=default> <meta name=mobile-web-app-capable content=yes> <meta name=apple-mobile-web-app-title content=Mattermost> <meta name=application-name content=Mattermost> <meta name=format-detection content="telephone=no"> <link rel=apple-touch-icon sizes=57x57 href=/static/files/787db8d8b82538cc1d5e8bcb8c21722d.png> <link rel=apple-touch-icon sizes=60x60 href=/static/files/cd9987714f4d92336c3ab203ff150a9a.png> <link rel=apple-touch-icon sizes=72x72 href=/static/files/1728fd5a009aabc77654b1f958c6f596.png> <link rel=apple-touch-icon sizes=76x76 href=/static/files/17cb12b7fc37d8229a6e72f3d6da0949.png> <link rel=apple-touch-icon sizes=144x144 href=/static/files/fba6362db1d8b3e27c9fb02fd0695c85.png> <link rel=apple-touch-icon sizes=120x120 href=/static/files/08959a08dc2488dfeb8660fc4630b145.png> <link rel=apple-touch-icon sizes=152x152 href=/static/files/bca263be9acd1df84b988b02c621b8ca.png> <link rel=icon type=image/png sizes=16x16 href=/static/files/532142b052832f94ffc35860545a7e5c.png> <link rel=icon type=image/png sizes=32x32 href=/static/files/c220e89731c31367c0f4e86e3442bee0.png> <link rel=icon type=image/png sizes=96x96 href=/static/files/173682cef105829829a008f1fc97e980.png> <link rel=icon type=image/png sizes=192x192 href=/static/files/0d367a00a16bde58f7e87c4481516a68.png> <link rel=manifest href=/static/files/fee9721a6305a49662a40ffd052a7965.json> <link rel=stylesheet class=code_theme> <script type="text/javascript" src="/static/main.598ce99103ba6aaf3db4.js"></script></head> <body> <div id=root> <div class=loading-screen style=position:relative> <div class=loading__content> <div class="round round-1"></div> <div class="round round-2"></div> <div class="round round-3"></div> </div> </div> </div> <script>window.setup_root()</script> <noscript> To use Mattermost, please enable JavaScript. </noscript> </body> </html>
http://localhost/mattermostに接続した際のエラーログです.
[Mon Apr 03 18:23:26.280899 2017] [authz_core:debug] [pid 19622] mod_authz_core.c(835): [client XXX.XXX.XX.XXX:56324] AH01628: authorization result: granted (no directives) [Mon Apr 03 18:23:26.292102 2017] [proxy:debug] [pid 19622] mod_proxy.c(1117): [client XXX.XXX.XX.XXX:56324] AH01143: Running scheme http handler (attempt 0) [Mon Apr 03 18:23:26.292131 2017] [proxy_ajp:debug] [pid 19622] mod_proxy_ajp.c(713): [client XXX.XXX.XX.XXX:56324] AH00894: declining URL http://localhost:8080/mattermost/ [Mon Apr 03 18:23:26.292876 2017] [proxy_fcgi:debug] [pid 19622] mod_proxy_fcgi.c(963): [client XXX.XXX.XX.XXX:56324] AH01076: url: http://localhost:8080/mattermost/ proxyname: (null) proxyport: 0 [Mon Apr 03 18:23:26.292889 2017] [proxy_fcgi:debug] [pid 19622] mod_proxy_fcgi.c(966): [client XXX.XXX.XX.XXX:56324] AH01077: declining URL http://localhost:8080/mattermost/ [Mon Apr 03 18:23:26.294088 2017] [proxy:debug] [pid 19622] proxy_util.c(2203): AH00942: HTTP: has acquired connection for (localhost) [Mon Apr 03 18:23:26.294115 2017] [proxy:debug] [pid 19622] proxy_util.c(2256): [client XXX.XXX.XX.XXX:56324] AH00944: connecting http://localhost:8080/mattermost/ to localhost:8080 [Mon Apr 03 18:23:26.298185 2017] [proxy:debug] [pid 19622] proxy_util.c(2422): [client XXX.XXX.XX.XXX:56324] AH00947: connected /mattermost/ to localhost:8080 [Mon Apr 03 18:23:26.298723 2017] [proxy:debug] [pid 19622] proxy_util.c(2798): AH02824: HTTP: connection established with XXX.XXX.XX.XXX:8080 (localhost) [Mon Apr 03 18:23:26.298766 2017] [proxy:debug] [pid 19622] proxy_util.c(2923): AH00962: HTTP: connection complete to XXX.XXX.XX.XXX:8080 (localhost) [Mon Apr 03 18:23:26.314379 2017] [proxy:debug] [pid 19622] proxy_util.c(2218): AH00943: http: has released connection for (localhost) [Mon Apr 03 18:23:26.693932 2017] [authz_core:debug] [pid 19622] mod_authz_core.c(809): [client XXX.XXX.XX.XXX:56324] AH01626: authorization result of Require all granted: granted [Mon Apr 03 18:23:26.693964 2017] [authz_core:debug] [pid 19622] mod_authz_core.c(809): [client XXX.XXX.XX.XXX:56324] AH01626: authorization result of <RequireAny>: granted [Mon Apr 03 18:23:26.694016 2017] [core:info] [pid 19622] [client XXX.XXX.XX.XXX:56324] AH00128: File does not exist: /var/www/html/static/main.598ce99103ba6aaf3db4.js [Mon Apr 03 18:23:26.766116 2017] [authz_core:debug] [pid 19622] mod_authz_core.c(809): [client XXX.XXX.XX.XXX:56324] AH01626: authorization result of Require all granted: granted [Mon Apr 03 18:23:26.766153 2017] [authz_core:debug] [pid 19622] mod_authz_core.c(809): [client XXX.XXX.XX.XXX:56324] AH01626: authorization result of <RequireAny>: granted [Mon Apr 03 18:23:26.766205 2017] [core:info] [pid 19622] [client XXX.XXX.XX.XXX:56324] AH00128: File does not exist: /var/www/html/static/files/0d367a00a16bde58f7e87c4481516a68.png
###補足情報(言語/FW/ツール等のバージョンなど)
Cent OS 7.1
Apache 2.4.6
nginx 1.10.3
MariaDB 10.1

回答1件
あなたの回答
tips
プレビュー