将原网站(微信业务)直接通过前端代理服务器(A)反向代理到后端机器(B)上会报一个 xxxx not in w […]
Nginx图片防盗链valid_referers
配置文件增加
1 2 3 4 5 6 7 8 |
location ~* \.(gif|jpg|png|jpeg)$ { expires 30d; valid_referers server_names *.xxx.com *.baidu.com *.google.com; if ($invalid_referer){ rewrite ^/ http://xxx/nolink.png; #return 404; } } |
以上配置注意空格 可以看到 [ […]
nginx、php-fpm、mysql用户权限解析
先来做个说明:nginx本身不能处理PHP,它只是个web服务器。当接收到客户端请求后,如果是php请求,则转 […]
nginx代理https后,应用redirect https变成http
情况说明 nginx 代理https后,应用redirect https变成http 情况类似 http:// […]
ownCloud的Nginx配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
upstream php-handler { server 127.0.0.1:9000; #server unix:/var/run/php5-fpm.sock; } server { listen 80; server_name example.com; return 301 https://$server_name$request_uri; } server { listen 443 ssl; server_name example.com; ssl_certificate /etc/ssl/nginx/cert.pem; ssl_certificate_key /etc/ssl/nginx/cert.key; root /var/www; client_max_body_size 1000M; # set max upload size fastcgi_buffers 64 4K; # ownCloud blacklist location ~ ^/owncloud/(?:\.htaccess|data|config|db_structure\.xml|README) { deny all; error_page 403 = /owncloud/core/templates/403.php; } location / { index index.html; } location /owncloud/ { error_page 403 = /owncloud/core/templates/403.php; error_page 404 = /owncloud/core/templates/404.php; rewrite ^/owncloud/caldav(.*)$ /remote.php/caldav$1 redirect; rewrite ^/owncloud/carddav(.*)$ /remote.php/carddav$1 redirect; rewrite ^/owncloud/webdav(.*)$ /remote.php/webdav$1 redirect; rewrite ^(/owncloud/core/doc[^\/]+/)$ $1/index.html; # The following rules are only needed with webfinger rewrite ^/owncloud/.well-known/host-meta /public.php?service=host-meta last; rewrite ^/owncloud/.well-known/host-meta.json /public.php?service=host-meta-json last; rewrite ^/owncloud/.well-known/carddav /remote.php/carddav/ redirect; rewrite ^/owncloud/.well-known/caldav /remote.php/caldav/ redirect; try_files $uri $uri/ index.php; } location ~ \.php(?:$|/) { fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param HTTPS on; fastcgi_pass php-handler; } # Optional: set long EXPIRES header on static assets location ~* ^/owncloud(/.+\.(jpg|jpeg|gif|bmp|ico|png|css|js|swf))$ { expires 30d; access_log off; # Optional: Don't log access to assets } } |
CentOS7 Nginx FastCGI sent in stderr: “Primary script unknown”
Hello world!
应用服务器配置SSL证书 + HTTPS站点
一、Nginx 1,生成SSL证书 2,nginx配置 [crayon-67b5b09777828710735 […]