Config nginx for Laravel In a subfolder

后端 未结 7 712
失恋的感觉
失恋的感觉 2020-12-14 18:28

I have and old project that now requires new functionality, I\'m going to use laravel to provide it, everything in working ok in xampp with apache but my server con nginx sh

7条回答
  •  别那么骄傲
    2020-12-14 19:13

    it did not work for me, so I got another solution.

    1. I had created a "normal" laravel domain, point to http://generic.laravel root /my/laravel/path/public

    2. After that, I created a location on real domain proxying to my generic Laravel:

      location /laravel {
          rewrite /laravel/?(.*)$ /$1 break;
          proxy_pass http://generic.laravel;
      

      }

    3. Unfortunately, Laravel is going to use the url http://generic.laravel to create links. You may to solve it following this steps Laravel: Change base URL?

提交回复
热议问题