如何使用端口

时间:2019-07-18 19:48:51

标签: apache nginx server nginx-config

我最近安装了Nginx,当我按下“提交”按钮或任何重定向它的操作时,都不会在链接中添加端口。在服务器上,我有用于nginx的端口80,在路由器上,我将端口80转换为22450外。我的链接是http://82.77.64.104:22450/playsms/。当我按登录时,它会将我重定向到http://82.77.64.104/playsms/而不是http://82.77.64.104:22450。 Nginx配置:

server {
        listen 80 default_server;
        listen [::]:80 default_server;


        root /var/www/html;

        # Add index.php to the list if you are using PHP
        index index.html index.htm index.nginx-debian.html index.php;

        server_name _;

        location / {
                # First attempt to serve request as file, then
                # as directory, then fall back to displaying a 404.
                try_files $uri $uri/ =404;
        }

        # pass PHP scripts to FastCGI server
        #

  location ~ \.php$ {
                include snippets/fastcgi-php.conf;
        #
        #       # With php-fpm (or other unix sockets):
                fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        #       # With php-cgi (or other tcp sockets):
        #       fastcgi_pass 127.0.0.1:9000;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #       deny all;
        #}
}

enter image description here

0 个答案:

没有答案