localhost 403 using nginx

14 views Asked by At

I'm getting a forbidden error on my localhost. I was able to access this on my different service unit. But I can't remember the configurations I made. And I didn't backup that config

I can't access the sample website I've been trying to do.

Here's my nginxconf.


`user  someuser staff;
worker_processes  1;

***SOME COMMENTS
events {
    worker_connections  1024;
}


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

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    log_format upstream '$remote_addr [$time_local] "$request" $server_protocol $status "$http_referer" "$http_user_agent" '
    'rt=$request_time uct=$upstream_connect_time uht=$upstream_header_time urt=$upstream_response_time $body_bytes_sent $ssl_cipher';

    log_format static '$remote_addr [$time_local] "$request" $server_protocol $status "$http_referer" "$http_user_agent" $body_bytes_sent $ssl_cipher';


    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       8080;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;
        
            root   /Users/someuser/repos/sites;
            index  index.php index.html index.htm;
        location / {
            root   html;
            index  index.php index.html index.htm;
        autoindex on;
        try_files $uri $uri/ /index.php?$args;
        proxy_buffer_size 128k;
        proxy_buffers 4 256k;
        proxy_busy_buffers_size 256k;
        }
    location ~ \.php$ {
#                fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

***SOME COMMENTS
    }

***SOME COMMENTS
    include servers/*;
}

`

I followed other articles, checked the permissions, ownerships. I'm not sure what I'm missing. I followed this text.

It was working on my previews unit.

Can somebody help me with this?

0

There are 0 answers