doumi1099 2018-01-29 21:41
浏览 121

nginx,docker和静态内容

I'm serving wordpress for most urls, and static content for a lot of legacy content. Everything under one domain name. Wordpress is served out of docker, via a proxy pass. Static files are just from a unique root.

location @docker {
    proxy_pass http://127.0.0.1:8007;
    proxy_set_header    Host $host;
    proxy_set_header    X-Forwarded-For  $proxy_add_x_forwarded_for;
    proxy_set_header    X-Forwarded-Proto    $scheme;
    proxy_set_header    Accept-Encoding  "";
    proxy_set_header    Proxy "";
}   


location / {
    include /etc/nginx/snippets/maritime_static_site.conf;
    root /mnt/code/maritime/maritime-static;
    #try_files $uri $uri/index.html $uri/index.htm $uri/index.php @docker;

    try_files $uri @docker;

    auth_basic "Private Beta";
    auth_basic_user_file /etc/nginx/.htpasswd-maritime;
}

location ~ \.php$ {

    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
} 

Static html, static php, and images are working. Wordpress is working. Wordpress admin (/wp-admin & wp-login.php) are giving file not found. I'm guessing it's trying files from the static root location. Any ideas how I can fix this?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题