V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  kmdd33  ›  全部回复第 12 页 / 共 15 页
回复总数  293
1 ... 4  5  6  7  8  9  10  11  12  13 ... 15  
2017-04-10 21:27:52 +08:00
回复了 ts9510 创建的主题 云计算 同志们同学们,支持 SSL 的 CDN 来一发推荐
@ts9510 我遇到的问题跟你差不多, ssl 支持的 cdn ,请问你现在用的是哪个?
2017-04-09 01:36:42 +08:00
回复了 ITOutsider 创建的主题 NGINX nginx 强制 https 浏览器总是提醒重定向过多不能正常访问网页
@cxbig centos7 , vhost 里面是空的,没有配置虚拟主机
看到了最近请求的一些信息,没看出来什么毛病啊?
2017-04-08 22:08:15 +08:00
回复了 ITOutsider 创建的主题 NGINX nginx 强制 https 浏览器总是提醒重定向过多不能正常访问网页
@lHUAC 请问你这个 代码
if ($server_port = 80){
return 301 https://$server_name$request_uri;}
if ($scheme = http){
return 301 https://$server_name$request_uri;}
error_page 497 https://$server_name$request_uri;
可以添加在 nginx.conf 里面的 server {}段里面的任意位置吗?
2017-04-08 21:54:51 +08:00
回复了 ITOutsider 创建的主题 NGINX nginx 强制 https 浏览器总是提醒重定向过多不能正常访问网页
@cxbig 请问你这个 if ($scheme = http) {
return 301 https://$server_name$request_uri;
} 可以添加在 nginx.conf 里面的 server {}段里面的任意位置吗?我也遇到了重定向次数过多的问题。
没有 vhosts 这个文件夹, whereis vhost 和 vhosts 都没有提示
@misaka19000 .com 那个疏忽错误已经修改过来,谢谢,观察的很细。
@Marfal 我也不清楚, nginx.conf 文件里面的设置正确吗?
@yangqi 我现在去查看一下这个文件夹
http://stackoverflow.com/questions/35143193/cloudflare-and-nginx-too-many-redirects
stackoverflow 有人说可以设置 302 临时,这个管用吗?如何修改成 302 重定向?
2017-04-08 00:39:42 +08:00
回复了 starvedcat 创建的主题 问与答 两门研究生课:计算机体系结构和编译器设计,选哪个
cmu 有个编译器设计课程 cs 多少来着
@nfroot 程序肯定没问题,我原来用 cloudflare 的 page rule 设置,很多错误解决不了,所以重新设置的 ssl
@nfroot ngnix.conf 配置有问题嘛?
威锋论坛,二手 macbookpro
2017-04-05 20:13:59 +08:00
回复了 kmdd33 创建的主题 问与答 console 出现了一个 error: the server responded with a status of 404
error.log 里面的错误是什么意思
自己的 nginx.conf 配置如下:
user www www;

worker_processes auto;

error_log /home/wwwlogs/nginx_error.log crit;

pid /usr/local/nginx/logs/nginx.pid;

#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;

events
{
use epoll;
worker_connections 51200;
multi_accept on;
}

http
{
map $http_cf_ipcountry $allow {
default yes;
CN yes;
RU no;
US yes;
}
include mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;

sendfile on;
tcp_nopush on;

keepalive_timeout 60;

tcp_nodelay on;

fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;

gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";

#limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.

server_tokens off;
access_log off;

server
{
if ($allow = no) {
return 403;
}
location / {

add_header 'Access-Control-Allow-Origin' 'https://www.mydomain.com';
}


add_header Content-Security-Policy upgrade-insecure-requests;
add_header 'Access-Control-Allow-origin' 'https://www.mydomain.com';
add_header 'Access-Control-Allow-Methods' 'GET, POST';
# Cross domain webfont access
location = /favicon.ico { log_not_found off; access_log off; }

location = /robots.txt { log_not_found off; access_log off; allow all; }

location ~* .(ogg|ogv|mp4|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
add_header "Access-Control-Allow-Origin" "https://www.mydomain.com";
add_header "Timing-Allow-Origin" "*";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
expires max;
log_not_found off;
}

location ~* .(ttf|ttc|otf|eot|woff|woff2|svg|svgz)$ {
add_header "Access-Control-Allow-Origin" "https://www.mydomain.com";
add_header "Timing-Allow-Origin" "*";
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
expires max;
log_not_found off;
}

listen 80 default_server;
listen 443 default_server;
#listen [::]:80 default_server ipv6only=on;
server_name www.mydomain.com;
index index.html index.htm index.php;
root /home/wwwroot/default;

#error_page 404 /404.html;
include enable-php.conf;

location /nginx_status
{
stub_status on;
access_log off;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}

location ~ .*\.(js|css)?$
{
expires 12h;
}



location ~ /\.
{
deny all;
}


access_log /home/wwwlogs/access.log;
}
include vhost/*.conf;
}
2017-04-02 23:19:35 +08:00
回复了 doufenger 创建的主题 问与答 如何禁止日本访客访问网站?
安装 csf 防火墙,参考我这篇文章: https://segmentfault.com/n/1330000008451475
@Antidictator 跟你设置的 301 重定向完全一致。也解决了 mixed content 的错误
@him007 一个一个改太麻烦了,我添加的 add_header Content-security-Policy upgrade-secure-requesrts 的目的就是让 http 升级到 https 的。
1 ... 4  5  6  7  8  9  10  11  12  13 ... 15  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2301 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 29ms · UTC 02:27 · PVG 10:27 · LAX 19:27 · JFK 22:27
Developed with CodeLauncher
♥ Do have faith in what you're doing.