https在NGINX服务器上

时间:2016-04-24 15:37:13

标签: ssl nginx https server

嗨我在使用FW Tomato by Shibby的mu home路由器ASUS N18U上运行NGINX服务器时遇到问题。我正在尝试为HTTPS配置它,但我不知道,我做错了什么。我生成了自签名证书并将其放到nginx配置文件中。证书由没有权限的人拥有644.您可以查看我的配置文件并给我任何建议吗?顺便说一句,我正在尝试配置owncloud,webUI工作正常,但我无法与应用程序同步,我认为我与WeDav连接(应用程序说上传失败甚至删除文件失败),请你提出建议吗?它让我发疯。

# NGinX generated config file
user    nobody;
worker_processes    1;
worker_cpu_affinity 0101;
master_process  off;
worker_priority 10;
error_log   /tmp/mnt/CORSAIR/nginx/error.log;
pid /tmp/var/run/nginx.pid;
worker_rlimit_nofile    8192;
events {
    worker_connections  512;
    }
http {
include /tmp/etc/nginx/mime.types;
include /tmp/etc/nginx/fastcgi.conf;
default_type    application/octet-stream;
log_format   main '$remote_addr - $remote_user [$time_local]  $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
sendfile    on;
client_max_body_size    100M;

server {
listen  80;
server_name _;
access_log  /tmp/mnt/CORSAIR/nginx/access.log   main;
location    /   {
root    /opt/owncloud;
index   index.html  index.htm   index.php;
error_page 404  /404.html;
error_page 500  502 503 504 /50x.html;
location    /50x.html   {
root    /opt/owncloud;
dav_methods PUT DELETE MKCOL COPY MOVE;

    create_full_put_path  on;
    dav_access            group:rw  all:r;

    limit_except GET {
        allow 192.168.1.0/32;
        deny  all;
}
location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ {
try_files   $script_name = 404;
include /tmp/etc/nginx/fastcgi.conf;
fastcgi_param PATH_INFO $path_info;
fastcgi_pass    127.0.0.1:9000;
    }
location ~ ^/(images|javascript|js|css|flash|media|static)/  {
root    /opt/owncloud;
expires 10d;
            }
        }

    }
server {
listen 443;
server_name _;
ssl on;
ssl_certificate /opt/owncloud/self-ssl.crt;
ssl_certificate_key /opt/owncloud/self-ssl.key;
access_log  /tmp/mnt/CORSAIR/nginx/access.log   main;
location        /       {
root    /opt/owncloud;
dav_methods PUT DELETE MKCOL COPY MOVE;

    create_full_put_path  on;
    dav_access            group:rw  all:r;

    limit_except GET {
        allow 192.168.1.0/32;
        deny  all;
index   index.html      index.htm       index.php;
error_page 404  /404.html;
fastcgi_param   HTTPS               on;
fastcgi_param   HTTP_SCHEME         https;
error_page 500  502     503     504     /50x.html;
location        /50x.html       {
root    /opt/owncloud;
}
location ~ ^(?<script_name>.+?\.php)(?<path_info>/.*)?$ {
try_files       $script_name = 404;
include /tmp/etc/nginx/fastcgi.conf;
fastcgi_param PATH_INFO $path_info;
fastcgi_pass    127.0.0.1:9000;
fastcgi_param   HTTPS               on;
fastcgi_param   HTTP_SCHEME         https;
        }
location ~ ^/(images|javascript|js|css|flash|media|static)/  {
root    /opt/owncloud;
expires 10d;


    }
}
}
}

0 个答案:

没有答案
相关问题