AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-414811

Isaac Palacio's questions

Martin Hope
Isaac Palacio
Asked: 2022-04-14 07:23:45 +0800 CST

Nginx Redict 不修改 url

  • 0

我想从一个域重定向到另一个域,但只从一个页面。

示例: https ://domainA.com/site/page到https://domainB.com/site/page

在nginx中我放了:

location /site {
         rewrite ^/site/page https://domainB.com/site/page break;
}

它有效,它做了rediction,但它改变了url,我希望url始终是https://domainA.com/site/page

我该怎么做才能使网址不变?

谢谢你!

rewrite nginx
  • 1 个回答
  • 39 Views
Martin Hope
Isaac Palacio
Asked: 2020-10-02 10:50:26 +0800 CST

注】/usr/sbin/mysqld(发起者:未知):正常关机

  • 1
2020-10-01 18:30:05 0 [Note] /usr/sbin/mysqld (initiated by: unknown): Normal shutdown
2020-10-01 18:30:05 0 [Note] Event Scheduler: Purging the queue. 0 events
2020-10-01 18:30:05 0 [Note] InnoDB: FTS optimize thread exiting.
2020-10-01 18:30:05 0 [Note] InnoDB: Starting shutdown...
2020-10-01 18:30:05 0 [Note] InnoDB: Dumping buffer pool(s) to /var/lib/mysql/ib_buffer_pool
2020-10-01 18:30:05 0 [Note] InnoDB: Instance 0, restricted to 2048 pages due to innodb_buf_pool_dump_pct=25
2020-10-01 18:30:05 0 [Note] InnoDB: Buffer pool(s) dump completed at 201001 18:30:05
2020-10-01 18:30:07 0 [Note] InnoDB: Shutdown completed; log sequence number 11518008272; transaction id 28700995
2020-10-01 18:30:07 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2020-10-01 18:30:07 0 [Note] /usr/sbin/mysqld: Shutdown complete

有一个进程或者什么导致Mysql服务器关闭,但是不知道是什么。

我用:

Debian 10 mysql Ver 15.1 Distrib 10.3.23-MariaDB,适用于使用 readline 5.2 的 debian-linux-gnu (x86_64)

服务器启动时:

2020-10-01 18:40:42 0 [Note] InnoDB: Using Linux native AIO
2020-10-01 18:40:42 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-10-01 18:40:42 0 [Note] InnoDB: Uses event mutexes
2020-10-01 18:40:42 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-10-01 18:40:42 0 [Note] InnoDB: Number of pools: 1
2020-10-01 18:40:42 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-10-01 18:40:42 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-10-01 18:40:42 0 [Note] InnoDB: Completed initialization of buffer pool
2020-10-01 18:40:42 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2020-10-01 18:40:42 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-10-01 18:40:42 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-10-01 18:40:42 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-10-01 18:40:42 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-10-01 18:40:42 0 [Note] InnoDB: 10.3.23 started; log sequence number 11518008272; transaction id 28700996
2020-10-01 18:40:42 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-10-01 18:40:42 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-10-01 18:40:42 0 [Note] Server socket created on IP: '127.0.0.1'.
2020-10-01 18:40:42 0 [Note] Reading of all Master_info entries succeeded
2020-10-01 18:40:42 0 [Note] Added new Master_info '' to hash table
2020-10-01 18:40:42 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.23-MariaDB-0+deb10u1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Debian 10
2020-10-01 18:40:42 0 [Note] InnoDB: Buffer pool(s) load completed at 201001 18:40:42
mysql shutdown
  • 1 个回答
  • 2473 Views
Martin Hope
Isaac Palacio
Asked: 2020-09-23 14:47:46 +0800 CST

nginx本地的几个站点

  • -1

如果我想在 3 个站点本地工作

站点 1 站点 2 站点 3

如何配置我的 nginx 和主机?

可用网站:

server_name site1

location / {
            proxy_pass http://127.0.0.1:81;
}

其他网站:

server_name 站点 2

location / {
            proxy_pass http://127.0.0.1:82;
}

server_name 站点 3

location / {
            proxy_pass http://127.0.0.1:83;
}

/etc/主机:

127.0.0.1   site1
127.0.0.1   site2
127.0.0.1   site3

这不起作用,他们将我带到同一个站点

subdomain nginx local
  • 1 个回答
  • 122 Views
Martin Hope
Isaac Palacio
Asked: 2017-06-01 23:28:14 +0800 CST

子域中的 Nginx:如果索引是 .html,如果下载索引是 .php,则错误 403 被禁止

  • 1

它只在子域中发生在我身上,其余的效果很好:

如果索引其扩展名是 htm 或 html 给出错误:

“403 禁止”

如果索引其扩展名是 php 尝试下载。

/ srv / www 中的权限对于所有子域都是相同的,并且它们有效。

我把配置conf:

server {
            ## Escucha en el puerto 80 (HTTP)
            listen 80;

            server_name musica.domain.com;

            location / {
                    return 301 https://$server_name$request_uri;
            }
}


server {
    ## Escucha en el puerto 443 (HTTPS)
    listen 443 ssl http2;

    server_name musica.domain.com;

    ## Certificados
    ssl_certificate /etc/letsencrypt/live/musica.domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/musica.domain.com/privkey.pem;
    include snippets/ssl-params.conf;

    access_log  /var/log/nginx/musica_access.log;
    error_log   /var/log/nginx/musica_error.log;

    root /srv/www/sonerezh;

    index index.html index.htm index.php;

    location ~ /.well-known {
            allow all;
    }

    location / {
#              try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php/musica.sock;
            #fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_index index.php;
            include fastcgi_params;
    }
}

该nginx -T命令显示您实际上正在读取子域配置文件。

子域访问日志:

195.16.143.6 - - [01/Jun/2017:09:16:29 +0200] "GET /favicon.ico HTTP/1.1" 404 143 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
195.16.143.6 - - [01/Jun/2017:09:17:26 +0200] "GET / HTTP/1.1" 200 90 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
195.16.143.6 - - [01/Jun/2017:10:09:59 +0200] "GET / HTTP/1.1" 200 90 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"
195.16.143.6 - - [01/Jun/2017:10:10:37 +0200] "GET / HTTP/1.1" 403 143 "-" "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0"

子域错误日志:

2017/06/01 09:16:29 [error] 3464#3464: *2295 open() "/srv/www/sonerezh/favicon.ico" failed (2: No such file or directory), client: 195.16.143.6, server: musica.domain.com, request: "GET /favicon.ico HTTP/1.1", host: "musica.domain.com"
2017/06/01 09:16:29 [error] 3464#3464: *2295 open() "/srv/www/sonerezh/favicon.ico" failed (2: No such file or directory), client: 195.16.143.6, server: musica.domain.com, request: "GET /favicon.ico HTTP/1.1", host: "musica.domain.com"
2017/06/01 10:10:37 [error] 3466#3466: *2350 directory index of "/srv/www/sonerezh/" is forbidden, client: 195.16.143.6, server: musica.domain.com, request: "GET / HTTP/1.1", host: "musica.domain.com"

nginx.conf:

user bichomen bichomen;

worker_processes auto;
worker_rlimit_nofile 2048;
#pcre_jit on;

pid /var/run/nginx.pid;

#                        [ debug | info | notice | warn | error | crit ]

error_log  /var/log/nginx.error_log  info;

events {
    worker_connections   2000;

    # use [ kqueue | epoll | /dev/poll | select | poll ];
    # use poll;
}


http {
    include mime.types;
    default_type application/octet-stream;


    log_format main      '$remote_addr - $remote_user [$time_local] '
                         '"$request" $status $bytes_sent '
                         '"$http_referer" "$http_user_agent" '
                         '"$gzip_ratio"';

    log_format download  '$remote_addr - $remote_user [$time_local] '
                         '"$request" $status $bytes_sent '
                         '"$http_referer" "$http_user_agent" '
                         '"$http_range" "$sent_http_content_range"';

    client_header_timeout  3m;
    client_body_timeout    3m;
    send_timeout           3m;

    client_header_buffer_size    1k;
    large_client_header_buffers  4 4k;

    gzip on;
    gzip_min_length  1100;
    gzip_buffers     4 8k;
    gzip_types       text/plain;

    output_buffers   1 32k;
    postpone_output  1460;

    sendfile         on;
    tcp_nopush       on;
    tcp_nodelay      on;
    send_lowat       12000;

    keepalive_timeout  75 20;

    #lingering_time     30;
    #lingering_timeout  10;
    #reset_timedout_connection  on;

    include sites-enabled/*.conf;
}

权限:

$ ls -l /srv/www/
drwxr-x--x  4 bichomen bichomen 4096 Jun  1 10:10 sonerezh

$ ls -l /srv/www/sonerezh/
-rw-rw-r-- 1 bichomen bichomen  90 Jun  1 09:15 index.html

使用 index.html

使用 index.php

nginx
  • 1 个回答
  • 2498 Views
Martin Hope
Isaac Palacio
Asked: 2017-05-31 00:02:57 +0800 CST

SSL_read()失败(SSL:错误:140943F2:SSL例程:SSL3_READ_BYTES:nginx中的sslv3错误

  • 0
2017/05/30 09:44:59 [debug] 3486#3486: *1221 free: 000055D2824FBC40, unused: 24
2017/05/30 09:57:01 [debug] 3486#3486: *1223 SSL certificate status callback
2017/05/30 09:57:01 [debug] 3486#3486: *1223 SSL_do_handshake: -1
2017/05/30 09:57:01 [debug] 3486#3486: *1223 SSL_get_error: 2
2017/05/30 09:57:01 [debug] 3486#3486: *1223 reusable connection: 0
2017/05/30 09:57:01 [debug] 3486#3486: *1223 SSL handshake handler: 0
2017/05/30 09:57:01 [debug] 3486#3486: *1223 SSL_do_handshake: 1
2017/05/30 09:57:01 [debug] 3486#3486: *1223 SSL: TLSv1.2, cipher: "ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD"
2017/05/30 09:57:01 [debug] 3486#3486: *1223 reusable connection: 1
2017/05/30 09:57:01 [debug] 3486#3486: *1223 http wait request handler
2017/05/30 09:57:01 [debug] 3486#3486: *1223 malloc: 000055D282587F80:1024
2017/05/30 09:57:01 [debug] 3486#3486: *1223 SSL_read: -1
2017/05/30 09:57:01 [debug] 3486#3486: *1223 SSL_get_error: 2
2017/05/30 09:57:01 [debug] 3486#3486: *1223 free: 000055D282587F80
2017/05/30 09:57:01 [debug] 3486#3486: *1223 http wait request handler
2017/05/30 09:57:01 [debug] 3486#3486: *1223 malloc: 000055D282587F80:1024
2017/05/30 09:57:01 [debug] 3486#3486: *1223 SSL_read: 0
2017/05/30 09:57:01 [debug] 3486#3486: *1223 SSL_get_error: 1
2017/05/30 09:57:01 [info] 3486#3486: *1223 SSL_read() failed (SSL: error:140943F2:SSL routines:SSL3_READ_BYTES:sslv3 alert unexpected message:SSL alert number 10) while waiting for request, client: 195.16.143.6, server: 0.0.0.0:443
2017/05/30 09:57:01 [debug] 3486#3486: *1223 close http connection: 38
2017/05/30 09:57:01 [debug] 3486#3486: *1223 SSL_shutdown: 1
2017/05/30 09:57:01 [debug] 3486#3486: *1223 event timer del: 38: 1496131081192
2017/05/30 09:57:01 [debug] 3486#3486: *1223 reusable connection: 0
2017/05/30 09:57:01 [debug] 3486#3486: *1223 free: 000055D282587F80
2017/05/30 09:57:01 [debug] 3486#3486: *1223 free: 000055D282508980, unused: 24

当我在 nginx 中启用 SSL3 时,我不明白这个错误,它只发生在这个子域中。其余的子域我有相同的,他们工作。

我的subdomain.conf:

ssl_certificate /etc/letsencrypt/live/musica.domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/musica.domain.com/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM$
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_stapling on;
ssl_stapling_verify on;

铬错误:

ERR_SSL_PROTOCOL_ERROR

Mozilla 错误:

连接到 musica.domain.com 时出错。SSL 收到意外的新会话票证握手消息。错误代码:SSL_ERROR_RX_UNEXPECTED_NEW_SESSION_TICKET

nginx
  • 2 个回答
  • 8160 Views
Martin Hope
Isaac Palacio
Asked: 2017-05-24 23:04:58 +0800 CST

Nginx 根目录不好

  • 0

我有个问题,

我在 nginx 中更改了子域的目录,

之前指出:

/srv/www/musica

现在它的目标是:

/srv/www/sonerezh

我已经配置了两个:

/etc/nginx/sites-available/musica.conf

作为:

/etc/php/5.6/fpm/pool.d/musica.conf

指向:

/srv/www/sonerezh

而且我已经重启了php和nginx的服务,但是nginx日志告诉我要继续找路径:

2017/05/24 08:54:26 [错误] 1580 # 1580: * 9974

/srv/www/musica/index.html" 找不到(2:没有这样的文件或目录)...

我不明白为什么会发生这种情况并且新的目录路径没有更新。

nginx
  • 1 个回答
  • 85 Views
Martin Hope
Isaac Palacio
Asked: 2017-05-18 22:40:52 +0800 CST

在 Nginx 中将 Sonerez 安装为子域

  • 0

安装 Sonerezh 时,它向我表明它没有找到安装。我把子域musica的配置代码:

server {
            ## Escucha en el puerto 80 (HTTP)
            listen 80;

            server_name musica.dominio.com;

            location / {
                    return 301 https://$server_name$request_uri;
            }
}

server {
    ## Escucha en el puerto 443 (HTTPS)
    listen 443 ssl http2;

    server_name musica.dominio.com;

    ## Certificados
    ssl_certificate /etc/letsencrypt/live/musica.dominio.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/musica.dominio.com/privkey.pem;

    access_log /var/log/nginx/musica_access.log;
    error_log /var/log/nginx/musica_error.log;

    root /srv/www/musica;

    index index.html index.htm index.php;

    location ~ /.well-known {
            allow all;
    }


    location / {
        alias /srv/www/musica/app/webroot/;
        try_files $uri $uri/ //musica/index.php?$args;

        location ~* /([^/]+_[0-9]+x[0-9]+(@[0-9]+x)?\.[a-z]+)$ {
            try_files /img/resized/$1 /index.php?$args;
            add_header Cache-Control 'public';
            expires 14d;
            access_log off;
        }


        location ~ /(.+\.php)$ {
            alias /srv/www/musica/app/webroot/$1;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php/musica.sock;
            fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
            fastcgi_index index.php;
            include fastcgi_params;
        }
    }
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/ssl/certs/dhparam.pem;
    ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DH$
    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:50m;
    ssl_stapling on;
    ssl_stapling_verify on;
    add_header Strict-Transport-Security max-age=15768000;

}

索涅列日

索涅列日日志:

2017/05/18 08:31:31 [error] 1579#1579: *1502 open() "/srv/www/musica/install" failed (2: No such file or directory),

我修改了配置文件,它给了我 403 Forbidden 错误

server {
    ## Escucha en el puerto 80 (HTTP)
            listen 80;

            server_name musica.dominio.com;
            root /srv/www/musica/public_html/app/webroot;

        access_log /var/log/nginx/musica_access.log;
        error_log /var/log/nginx/musica_error.log;

    index index.php;

        location ~ /.well-known {
               allow all;
        }

        location / {
                try_files $uri $uri/ /index.php?$args;
                expires 14d;
                add_header Cache-Control 'public';
        }

       location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php/musica.sock;
            fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_intercept_errors off;
            fastcgi_buffer_size 16k;
            fastcgi_buffers 4 16k;
        }

}

nginx
  • 1 个回答
  • 143 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve