Nginx 403 Error (FIXED)
-
After installing the full version of Laragon equip with Nginx, I cannot access any of my websites. I simply get a 403 error. I'm running Windows 10 Enterprise and my permissions seem correct. This is a fresh, clean installation.
What additional information can I provide to help? Thanks!
-
@MightyRufo: There is an error.log file (Menu > nginx > error.log). On the file, you'll find the reasons of 403 error.
-
The error that I receive in said file is "12492#10748: *10 access forbidden by rule, client: 192.168.1.93, server: localhost, request: "GET / HTTP/1.1", host: "192.168.1.93""
This leads me to believe that a setting within ngnix is not allowing access. What does this look like to you, Leo?
-
@MightyRufo: That's the point. You should change your nginx's server setting to allow access from 192.168.1.93
Google is your friend, if not please feel free to ask
-
I did try googling for it, but I had trouble finding what settings to change as there are mixed fixes for this problem. How do I allow access to a URL or IP Address?
-
Open your virtual host/server (Menu > nginx > sites-enabled > auto.xxx.dev.conf)
Addallow all;
below proper location directives (or all of them if you are not sure);
location / { allow all; try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { allow all; include snippets/fastcgi-php.conf; fastcgi_pass php_upstream; #fastcgi_pass unix:/run/php/php7.0-fpm.sock; }
Reload nginx and check if it works.
If yes, test again, in that case just allow a specific IP:allow 1192.168.1.93;
-
Well, I had to apply those settings to the default conf file and it worked! You are awesome Leo! However, now I can't seem to get Nginx to serve a webpage. I'm trying to access wordpress here. The address seems correct, but my browser just seems to endlessly try to load the webpage. There are no errors in the log file, so i'm at a loss.
-
@MightyRufo : I don't know why it happened to you because default installation of Laragon doesn't require users to do any further settings.
I suggest you to test with a blank installation of Laragon 2.2.2 (you can keep the previous one) by:
- Exit current Laragon
- Install Laragon's Nginx to C:\lara
- Test
Quick Create
website with Wordpress
-
I did exactly as you mentioned, and i'm still left with the same result. apche works great! I used that for a while, but now i was looking forward to the speed benefits.
I'll install it on another computer and see how it fairs there.
EDIT: hmm, I installed it on a different machine and it works. That's very odd. I'll have to see what I can do. Thanks for the help Leo!
-
Strange, no one reports the same issue as yours. I'll see your result on another computer/VM
-
The problem seems to have gone away.. somehow.. for some unknown reason.. out of nowhere... I mean that's cool..
So, uh, it's fixed! lmao
-
Cool! glad to hear it worked
-
Hey, Did you tried to access the same page from some other pc or laptop? If the problem persists then it may be beacuse the webiste owner has restricted you from access that page. Well there's a simple soln. to it..Install gom vpn extension from HackBS|GOM VPN trick.it will let you bypass this restriction in seconds.