Nginx 不遵循符号链接。我收到 404 错误。在我的目录中,我有这个链接:
lrwxrwxrwx 1 root root 48 Sep 23 08:52 modules -> /path/to/dir/
Run Code Online (Sandbox Code Playgroud)
但是/path/to/dir找不到存储在其中的文件。
我有一个在 上运行的服务(docker 注册表)port 5000,我已经安装了 nginx 以将 http 请求从 重定向8080到5000。如果我卷曲localhost:5000它可以工作,但是当我卷曲它时,localhost:8080我会收到一个错误的网关错误。
nginx配置文件:
upstream docker-registry {
server localhost:5000;
}
server {
listen 8080;
server_name registry.mydomain.com;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 0;
chunked_transfer_encoding on;
location / {
proxy_pass http://docker-registry;
}
location /_ping {
auth_basic off;
proxy_pass http://docker-registry;
}
location /v1/_ping {
auth_basic off;
proxy_pass http://docker-registry;
}
}
Run Code Online (Sandbox Code Playgroud)
在/var/log/nginx/error.log我有:
[crit] 15595#0: *1 connect() to [::1]:5000 failed (13: Permission denied) …Run Code Online (Sandbox Code Playgroud) 嗨,我需要通过减少 /home 来增加根分区空间,在 Centos 6.6 中,我的情况是这样的:
/dev/mapper/VolGroup-lv_root 50G 46G 1,6G 97% /
tmpfs 1,9G 0 1,9G 0% /dev/shm
/dev/sda1 477M 61M 391M 14% /boot
/dev/mapper/VolGroup-lv_home 140G 3,9G 129G 3% /home
Run Code Online (Sandbox Code Playgroud)
是否可以?
我需要配置 HAproxy 以使用 SSL 重定向多个域,我需要以这种方式重定向:
www.foo.com redirect to ip_other_webserver:81
www.bar.com redirect to ip_other_webserver:82
www.zoo.com redirect to ip_other_webserver:8080
Run Code Online (Sandbox Code Playgroud)
我不知道 HAproxy,过去我用 nginx 做了相同的配置,但我也需要负载均衡器。我找不到配置示例。谢谢
我需要 gevent 来运行 docker-registry 但我有这个错误:
Error: class uri 'gevent' invalid or not found:
[Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 139, in load_class
mod = import_module('.'.join(components))
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/ggevent.py", line 22, in <module>
raise RuntimeError("You need gevent installed to use this worker.")
RuntimeError: You need gevent installed to use this worker.
]
Run Code Online (Sandbox Code Playgroud)
我试图与安装GEVENTapt-get和pip,但运行命令时,始终这个错误
更新:
Debian 7.8 64 位
输出 dpkg -l | grep python
ii libpython2.6 2.6.8-1.1 amd64 Shared …Run Code Online (Sandbox Code Playgroud) 我已将 Apache 从 2.2 升级到 2.4,但遇到字符编码问题。在我的页面中,我有è=è ò=ò ì=ì等...
在我的httpd.conf我已经评论了默认值并添加了ISO-8859-1(西欧)
#AddDefaultCharset UTF-8
AddDefaultCharset ISO-8859-1
Run Code Online (Sandbox Code Playgroud)
但这并没有改变任何事情。
我需要设置 Nginx 以便它响应 http 和 https 请求;我以这种方式配置了我的默认配置:
server {
listen 80;
listen 443;
ssl on;
ssl_certificate /etc/nginx/certs/domain-bundle.crt;
ssl_certificate_key /etc/nginx/certs/domain.it.key;
server_name static.domain.it;
location / {
try_files $uri @s3cache;
}
location @s3cache{
proxy_cache S3CACHE;
proxy_cache_valid 200 48h;
proxy_cache_valid 403 60m;
proxy_pass http://static.domain.it.s3-external-3.amazonaws.com;
}
}
Run Code Online (Sandbox Code Playgroud)
https 协议工作正常,但如果我发出 http 请求,则会收到此错误:
400 Bad Request
The plain HTTP request was sent to HTTPS port
Run Code Online (Sandbox Code Playgroud) 我在 apache 2.4 中的基本身份验证有问题。我有这些行:
<VirtualHost *:80>
ServerAdmin email@email.com
DocumentRoot /var/www/html/foo
ServerName my.domain.com
<Directory /var/www/html/foo/>
Options FollowSymLinks
Require all granted
DirectoryIndex index.php
AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/etc/httpd/.htpasswd"
Require valid-user
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
身份验证被绕过并在没有密码请求的情况下显示站点。
我将 nginx 设置为 docker 注册表的 proxypass,协议 http 有效,但如果我设置了 https,我有: 400 The plain HTTP request was sent to HTTPS port
这是我的 nginx 配置文件:
upstream docker-registry {
server 127.0.0.1:5000;
}
server {
listen 443 ssl;
server_name docker-registry.mydomain.it;
ssl_certificate /etc/ssl/certs/docker-registry;
ssl_certificate_key /etc/ssl/private/docker-registry;
proxy_set_header Host $http_host; # required for Docker client sake
proxy_set_header X-Real-IP $remote_addr; # pass on real client IP
client_max_body_size 0; # disable any limits to avoid HTTP 413 for large image uploads
# required to avoid HTTP 411: see Issue #1486 …Run Code Online (Sandbox Code Playgroud)