Laravel 403 forbidden error in Ubuntu LEMP stacknginx change root folder for specyfic urlnginx 403 forbidden under Debian 7nginx + php-fpm + pidora(fedora) on raspberryVagrant / puppet config for complex vhost setting (if statements etc.)?Share Nginx server configurationNginx PHP7.0-FPM No such file or directory UbuntuStrange Nginx behavior with trailing slashesPHP-FPM socket on remote machineCannot get index.php page to display in docker containerhow to setup nginx having react pwa in one folder and php apis in other?

Are all instances of trolls turning to stone ultimately references back to Tolkien?

Archery in modern conflicts

Swapping rooks in a 4x4 board

Can we put equal sign after aggregate functions in sql?

Find the probability that the 8th woman to appear is in 17th position.

C-152 carb heat on before landing in hot weather?

How long would it take to cross the Channel in 1890's?

What is the legal status of travelling with methadone in your carry-on?

Why do some professors with PhDs leave their professorships to teach high school?

What is the origin of Scooby-Doo's name?

How much will studying magic in an academy cost?

Fedora boot screen shows both Fedora logo and Lenovo logo. Why and How?

Does Marvel have an equivalent of the Green Lantern?

How does a blind passenger not die, if driver becomes unconscious

Should developer taking test phones home or put in office?

How dangerous are set-size assumptions?

Long term BTC investing

Should my manager be aware of private LinkedIn approaches I receive? How to politely have this happen?

Underbar nabla symbol doesn't work

Would it be a copyright violation if I made a character’s full name refer to a song?

If I wouldn't want to read the story, is writing it still a good idea?

Where can I find a database of galactic spectra?

Impossible darts scores

Is adding a new player (or players) a DM decision, or a group decision?



Laravel 403 forbidden error in Ubuntu LEMP stack


nginx change root folder for specyfic urlnginx 403 forbidden under Debian 7nginx + php-fpm + pidora(fedora) on raspberryVagrant / puppet config for complex vhost setting (if statements etc.)?Share Nginx server configurationNginx PHP7.0-FPM No such file or directory UbuntuStrange Nginx behavior with trailing slashesPHP-FPM socket on remote machineCannot get index.php page to display in docker containerhow to setup nginx having react pwa in one folder and php apis in other?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have installed laravel in the "/var/www" folder but I am getting 403 forbidden error, and folders in the "var/www" folder have a lock icon. How can i fix this problem ?



Settings like this:



 # Don't use them in a production server 
root /var/www/html;

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

server_name 192.168.1.6;

location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;


# 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.0-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;

}









share|improve this question
























  • Could you provide more details. I can help you sort this. Like the root document in your LEMP setup and if you have set the necessary permissions on appropriate folders

    – makamu evans
    Mar 25 at 9:43











  • Have you tried to find a problem in nginx an php-fpm logs first?

    – Alex
    Mar 25 at 9:48











  • I updated my question, please check.

    – dlpnt
    Mar 25 at 10:00

















0















I have installed laravel in the "/var/www" folder but I am getting 403 forbidden error, and folders in the "var/www" folder have a lock icon. How can i fix this problem ?



Settings like this:



 # Don't use them in a production server 
root /var/www/html;

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

server_name 192.168.1.6;

location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;


# 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.0-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;

}









share|improve this question
























  • Could you provide more details. I can help you sort this. Like the root document in your LEMP setup and if you have set the necessary permissions on appropriate folders

    – makamu evans
    Mar 25 at 9:43











  • Have you tried to find a problem in nginx an php-fpm logs first?

    – Alex
    Mar 25 at 9:48











  • I updated my question, please check.

    – dlpnt
    Mar 25 at 10:00













0












0








0








I have installed laravel in the "/var/www" folder but I am getting 403 forbidden error, and folders in the "var/www" folder have a lock icon. How can i fix this problem ?



Settings like this:



 # Don't use them in a production server 
root /var/www/html;

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

server_name 192.168.1.6;

location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;


# 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.0-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;

}









share|improve this question
















I have installed laravel in the "/var/www" folder but I am getting 403 forbidden error, and folders in the "var/www" folder have a lock icon. How can i fix this problem ?



Settings like this:



 # Don't use them in a production server 
root /var/www/html;

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

server_name 192.168.1.6;

location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;


# 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.0-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;

}






laravel nginx






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 13:06









Marcin Orlowski

1




1










asked Mar 25 at 9:41









dlpntdlpnt

245 bronze badges




245 bronze badges












  • Could you provide more details. I can help you sort this. Like the root document in your LEMP setup and if you have set the necessary permissions on appropriate folders

    – makamu evans
    Mar 25 at 9:43











  • Have you tried to find a problem in nginx an php-fpm logs first?

    – Alex
    Mar 25 at 9:48











  • I updated my question, please check.

    – dlpnt
    Mar 25 at 10:00

















  • Could you provide more details. I can help you sort this. Like the root document in your LEMP setup and if you have set the necessary permissions on appropriate folders

    – makamu evans
    Mar 25 at 9:43











  • Have you tried to find a problem in nginx an php-fpm logs first?

    – Alex
    Mar 25 at 9:48











  • I updated my question, please check.

    – dlpnt
    Mar 25 at 10:00
















Could you provide more details. I can help you sort this. Like the root document in your LEMP setup and if you have set the necessary permissions on appropriate folders

– makamu evans
Mar 25 at 9:43





Could you provide more details. I can help you sort this. Like the root document in your LEMP setup and if you have set the necessary permissions on appropriate folders

– makamu evans
Mar 25 at 9:43













Have you tried to find a problem in nginx an php-fpm logs first?

– Alex
Mar 25 at 9:48





Have you tried to find a problem in nginx an php-fpm logs first?

– Alex
Mar 25 at 9:48













I updated my question, please check.

– dlpnt
Mar 25 at 10:00





I updated my question, please check.

– dlpnt
Mar 25 at 10:00












1 Answer
1






active

oldest

votes


















0














If your laravel installation is under /var/www/html then you will need to update your nginx conf file to root /var/www/html/public;. Your configuration file looks ok to me except the public part.



Laravel's index.php is located in the public folder.



# Don't use them in a production server 
root /var/www/html/public; # This line.

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

server_name 192.168.1.6;

location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;


# 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.0-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;



}






share|improve this answer























  • Thank you but i cant make it. I'm gonne install homestead

    – dlpnt
    Mar 25 at 15:03













Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55334925%2flaravel-403-forbidden-error-in-ubuntu-lemp-stack%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














If your laravel installation is under /var/www/html then you will need to update your nginx conf file to root /var/www/html/public;. Your configuration file looks ok to me except the public part.



Laravel's index.php is located in the public folder.



# Don't use them in a production server 
root /var/www/html/public; # This line.

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

server_name 192.168.1.6;

location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;


# 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.0-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;



}






share|improve this answer























  • Thank you but i cant make it. I'm gonne install homestead

    – dlpnt
    Mar 25 at 15:03















0














If your laravel installation is under /var/www/html then you will need to update your nginx conf file to root /var/www/html/public;. Your configuration file looks ok to me except the public part.



Laravel's index.php is located in the public folder.



# Don't use them in a production server 
root /var/www/html/public; # This line.

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

server_name 192.168.1.6;

location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;


# 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.0-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;



}






share|improve this answer























  • Thank you but i cant make it. I'm gonne install homestead

    – dlpnt
    Mar 25 at 15:03













0












0








0







If your laravel installation is under /var/www/html then you will need to update your nginx conf file to root /var/www/html/public;. Your configuration file looks ok to me except the public part.



Laravel's index.php is located in the public folder.



# Don't use them in a production server 
root /var/www/html/public; # This line.

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

server_name 192.168.1.6;

location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;


# 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.0-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;



}






share|improve this answer













If your laravel installation is under /var/www/html then you will need to update your nginx conf file to root /var/www/html/public;. Your configuration file looks ok to me except the public part.



Laravel's index.php is located in the public folder.



# Don't use them in a production server 
root /var/www/html/public; # This line.

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

server_name 192.168.1.6;

location /
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;


# 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.0-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;



}







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 25 at 12:55









OdysseeOdyssee

7814 silver badges22 bronze badges




7814 silver badges22 bronze badges












  • Thank you but i cant make it. I'm gonne install homestead

    – dlpnt
    Mar 25 at 15:03

















  • Thank you but i cant make it. I'm gonne install homestead

    – dlpnt
    Mar 25 at 15:03
















Thank you but i cant make it. I'm gonne install homestead

– dlpnt
Mar 25 at 15:03





Thank you but i cant make it. I'm gonne install homestead

– dlpnt
Mar 25 at 15:03



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55334925%2flaravel-403-forbidden-error-in-ubuntu-lemp-stack%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript