Laravel in subdirectory – nginx vhost setup

Big credit goes to Hamid Naghipour on stackoverflow for this helpful piece of code https://stackoverflow.com/questions/27785372/config-nginx-for-laravel-in-a-subfolder

Let’s say we have a domain test.sk and we want to install 2 separate laravel installations in subfolders /2018 and 2019/.

Here is a basic setup that works


server {
    listen 80;
    server_name test.sk;	
    root /storage/web/test;


	location /2018 {

		alias /storage/web/test/2018/public;
		try_files $uri $uri/ @nested2018;
	        satisfy any;
	        allow all;
	        index index.php;

		location ~ \.php$ {
	        try_files $uri =404;
	        fastcgi_pass 127.0.0.1:9000;
	        index index.php;
	        fastcgi_index index.php;
	        fastcgi_param SCRIPT_FILENAME $request_filename;
	        include fastcgi_params;
		}
	}

	location @nested2018 {
		rewrite /2018/(.*)$ /2018/index.php?/$1 last;
	}


	location /2019 {

		alias /storage/web/test/2019/public;
		try_files $uri $uri/ @nested2019;
	        satisfy any;
	        allow all;
	        index index.php;

		location ~ \.php$ {
	        try_files $uri =404;
	        fastcgi_pass 127.0.0.1:9000;
	        index index.php;
	        fastcgi_index index.php;
	        fastcgi_param SCRIPT_FILENAME $request_filename;
	        include fastcgi_params;
		}
	}

	location @nested2019 {
		rewrite /2019/(.*)$ /2019/index.php?/$1 last;
	}


    location / {
    	rewrite ^(.*)$ https://$server_name/2018$1 permanent;
    }

}

Write a Comment

Comment

Webmentions

  • وکیل مهریه مددی

    وکیل مهریه مددی

    Laravel in subdirectory – nginx vhost setup

  • obecný online kanada kamagra

    levné kamagra no rx

    koupit kamagra z usa lékárny bez lékařského předpisu

  • online order rifaximin overnight no rx

    buying rifaximin united kingdom

    how to buy rifaximin cost tablet

  • buy cheap avodart cheap fast shipping

    cheapest buy avodart generic canadian

    how to order avodart generic order

  • buy staxyn price uk

    get staxyn ireland over the counter

    buy no prescription staxyn

  • discount itraconazole purchase uk

    get itraconazole generic online cheapest

    online order itraconazole generic london

  • how to buy gabapentin purchase to canada

    gabapentin ups

    how to order gabapentin usa online pharmacy

  • discount fildena buy japan

    discount fildena generic tablets

    cheap fildena next day delivery

  • cheap dutasteride usa drugstore

    how to buy dutasteride price for prescription

    online order dutasteride cheap uk

  • buy cheap flexeril cyclobenzaprine canadian sales

    buy flexeril cyclobenzaprine generic ingredients

    cheap flexeril cyclobenzaprine fedEx

  • androxal no prescription overnight cod delivery

    get androxal buy germany

    buy cheap androxal canada how to buy

  • discount enclomiphene canada on sale

    buy enclomiphene generic cheapest

    online order enclomiphene generic uk buy

  • kamagra sans ordonnance pas cher

    generique kamagra generique acheter pharmacie en ligne

    acheter kamagra prescrire united nations medicament

  • web page

    web page

    Laravel in subdirectory – nginx vhost setup

  • https://1win.fyi/

    https://1win.fyi/

    Laravel in subdirectory – nginx vhost setup

  • java 3

    java 3

    Laravel in subdirectory – nginx vhost setup

  • permainan slot online adalah

    permainan slot online adalah

    Laravel in subdirectory – nginx vhost setup

  • Amino Muscle Reviews

    Amino Muscle Reviews

    Laravel in subdirectory – nginx vhost setup

  • www.rsstop10.com

    http://www.rsstop10.com

    Laravel in subdirectory – nginx vhost setup

  • Glory

    Glory

    Laravel in subdirectory – nginx vhost setup

  • How to choose womens watches?

    How to choose womens watches?

    Laravel in subdirectory – nginx vhost setup

  • Mejahoki Togel SGP

    Mejahoki Togel SGP

    Laravel in subdirectory – nginx vhost setup

  • Mildcasino Berita Bola

    Mildcasino Berita Bola

    Laravel in subdirectory – nginx vhost setup

  • Alexavegas Alternatif

    Alexavegas Alternatif

    Laravel in subdirectory – nginx vhost setup

  • 31231

    31231

    Laravel in subdirectory – nginx vhost setup

  • https://mywallet-check.com/

    https://mywallet-check.com/

    Laravel in subdirectory – nginx vhost setup

  • bentuk kontol

    bentuk kontol

    Laravel in subdirectory – nginx vhost setup

  • пинко казино регистрация

    пинко казино регистрация

    Laravel in subdirectory – nginx vhost setup

  • kantor bola

    kantor bola

    Laravel in subdirectory – nginx vhost setup

  • My Homepage

    … [Trackback]

    […] Informations on that Topic: phpsolved.com/laravel-in-subdirectory-nginx-vhost-setup/trackback/ […]