如何解决Nginx 配置不代理到 keycloak 服务器
我在 CentOs 的公共云上设置了 Keycloak 服务器,该服务器在 8080
端口上运行,我可以从浏览器访问该端口。
我已经使用以下配置设置了 Nginx
反向代理。当我点击 URL 时,我在屏幕上看到一个 notification message
我哪里出错了。
我收到以下来自 /var/log/nginx/error.log
2021/05/13 12:00:45 [crit] 15247#0: *84 open() "/var/lib/nginx/tmp/proxy/3/03/0000000033" failed (13: Permission denied) while reading upstream,client: 106.51.240.105,server:,request: "GET /auth/resources/icg6b/common/keycloak/node_modules/angular/angular.min.js HTTP/1.1",upstream: "http://127.0.0.1:8080/auth/resources/icg6b/common/keycloak/node_modules/angular/angular.min.js",host: "161.35.23.133"
2021/05/13 12:00:45 [crit] 15247#0: *87 open() "/var/lib/nginx/tmp/proxy/4/03/0000000034" failed (13: Permission denied) while reading upstream,request: "GET /auth/resources/icg6b/common/keycloak/lib/ui-ace/min/ace.js HTTP/1.1",upstream: "http://127.0.0.1:8080/auth/resources/icg6b/common/keycloak/lib/ui-ace/min/ace.js",host: "161.35.23.133"
2021/05/13 12:00:46 [crit] 15247#0: *89 open() "/var/lib/nginx/tmp/proxy/5/03/0000000035" failed (13: Permission denied) while reading upstream,request: "GET /auth/resources/icg6b/admin/keycloak/js/app.js HTTP/1.1",upstream: "http://127.0.0.1:8080/auth/resources/icg6b/admin/keycloak/js/app.js",host: "161.35.23.133"
2021/05/13 12:00:46 [crit] 15247#0: *91 open() "/var/lib/nginx/tmp/proxy/6/03/0000000036" failed (13: Permission denied) while reading upstream,request: "GET /auth/resources/icg6b/admin/keycloak/js/controllers/clients.js HTTP/1.1",upstream: "http://127.0.0.1:8080/auth/resources/icg6b/admin/keycloak/js/controllers/clients.js",host: "161.35.23.133"
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
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 /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
server {
listen 80 default_server;
listen [::]:80 default_server;
proxy_set_header X-Forwarded-For $proxy_protocol_addr;
# To forward the original client's IP address
proxy_set_header X-Forwarded-Proto $scheme;
# to forward the original protocol (HTTP or HTTPS)
proxy_set_header Host $host;
# to forward the original host requested by the client
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
proxy_pass http://localhost:8080;
}
...
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。