如何将端口8080切换到Nginx Bitnami中的端口80

时间:2015-12-06 05:34:36

标签: php nginx bitnami

我在我的本地Mac上使用Nginx Bitnami堆栈。 Nginx在端口8080上工作。如何将端口8080更改为端口80.它工作localhost:8080但我需要localhost。 我正在使用此配置。



    # HTTP server

    server {
        listen       8080;
        server_name  localhost;

        location / {
            root   html;
            index  index.html index.htm;
        }

        include "/Applications/nginxstack/nginx/conf/bitnami/phpfastcgi.conf";

        include "/Applications/nginxstack/nginx/conf/bitnami/bitnami-apps-prefix.conf";
    }

    # HTTPS server
    
    server {
       listen       8443;
       server_name  localhost;

       ssl_certificate      server.crt;
       ssl_certificate_key  server.key;

       ssl_session_cache    shared:SSL:1m;
       ssl_session_timeout  5m;

       ssl_ciphers  HIGH:!aNULL:!MD5;
       ssl_prefer_server_ciphers  on;

       location / {
           root   html;
           index  index.html index.htm;
       }

       include "/Applications/nginxstack/nginx/conf/bitnami/phpfastcgi.conf";

       include "/Applications/nginxstack/nginx/conf/bitnami/bitnami-apps-prefix.conf";
    }


    include "/Applications/nginxstack/nginx/conf/bitnami/bitnami-apps-vhosts.conf";




1 个答案:

答案 0 :(得分:0)

MAC默认使用MAMPP或Apache服务器。首先从MAC OS卸载MAMPP或Apache Server。

因为Apache服务器使用80端口来运行Web服务器。

然后将Nginx的端口更改为80

服务器{

def multi(n):
   if n>0:
        return n * multi(n-1)
   else:
        return 0

重新加载Nginx服务器

我认为这会帮助你