[prev in list] [next in list] [prev in thread] [next in thread]
List: nginx
Subject: Re: WordPress multisite with root url as Laravel application
From: Danila Vershinin <ciapnz () gmail ! com>
Date: 2018-08-17 18:46:54
Message-ID: 1B43387F-5F9D-41E3-955F-A164DE9566C9 () gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/alternative)]
Hi,
Why not just create 2 server blocks, one for root domain and the other for WP multisite subdomains?
As in:
server {
server_name example.com <http://example.com/> www.example.com <http://www.example.com/>;
… Laravel directives go here
}
server {
server_name *.example.com <http://example.com/>;
.. WP multisite directives go here
}
Best Regards,
Danila
> On 17 Aug 2018, at 16:49, conquistadorjd <nginx-forum@forum.nginx.org> wrote:
>
> I am running a wordpress multisite website with subdomain option. example.me
> is my main website https://one.example.me, https://two.example.me/two etc
> are the network websites.
>
> Now I am planning to have a small laravel application accessible at
> example.me. I tried using different combination but not able to figure this
> out. Could not find any examples in search results as well.Can someone let
> me know how can I use laravel webapp at main/root address https://example.me
> and mutilsite with subdomain ?
>
> I am new to NGINX. Here is my nginx code.
>
> map $http_host $blogid {
> default 0;
> include
> /var/www/goingplacesme/wp-content/uploads/nginx-helper/map.conf;
> }
>
> server {
> listen 80;
> listen [::]:80;
>
> root /var/www/exampleme;
>
> index index.html index.htm index.nginx-debian.html;
>
> server_name example.me www.example.me;
>
> location / {
> #try_files $uri $uri/ =404;
> try_files $uri /index.php$is_args$args;
> }
>
> # pass the PHP scripts to FastCGI server listening on
> 127.0.0.1:9000
> location ~ \.php$ {
> include snippets/fastcgi-php.conf;
>
> # With php7.0-cgi alone:
> #fastcgi_pass 127.0.0.1:9000;
> # With php7.0-fpm:
> fastcgi_pass unix:/run/php/php7.0-fpm.sock;
> }
>
> # deny access to .htaccess files, if Apache's document root
> # concurs with nginx's one
> #
> #location ~ /\.ht {
> # deny all;
> #}
> location ~ ^/files/(.*)$ {
> try_files /wp-content/blogs.dir/$blogid/$uri
> /wp-includes/ms-files.php?file=$1 ;
> access_log off; log_not_found off; expires max;
> }
>
> location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
> expires 24h;
> log_not_found off;
> }
>
> location ^~ /blogs.dir {
> internal;
> alias /var/www/pathtoyoursite/web/wp-content/blogs.dir ;
> access_log off; log_not_found off; expires max;
> }
>
>
>
> if (!-e $request_filename) {
> rewrite /wp-admin$ $scheme://$host$uri/ permanent;
> rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
> rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
> }
>
> }
>
> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,280904,280904#msg-280904
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
[Attachment #7 (unknown)]
<html><head><meta http-equiv="Content-Type" content="text/html; \
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
line-break: after-white-space;" class=""><div class="">Hi,</div><div class=""><br \
class=""></div>Why not just create 2 server blocks, one for root domain and the other \
for WP multisite subdomains?<div class=""><br class=""></div><div class="">As \
in:</div><div class=""><br class=""></div><div class=""><font face="Courier New" \
class="">server {</font></div><div class=""><font face="Courier New" class=""> \
server_name <a href="http://example.com" class="">example.com</a> <a \
href="http://www.example.com" class="">www.example.com</a>;</font></div><div \
class=""><font face="Courier New" class=""> … Laravel directives go \
here</font></div><div class=""><font face="Courier New" class="">}</font></div><div \
class=""><font face="Courier New" class=""><br class=""></font></div><div \
class=""><font face="Courier New" class="">server {</font></div><div class=""><font \
face="Courier New" class=""> server_name *.<a href="http://example.com" \
class="">example.com</a>;</font></div><div class=""><font face="Courier New" \
class=""> .. WP multisite directives go here</font></div><div class=""><font \
face="Courier New" class="">}</font></div><div class=""><br class=""></div><div \
class=""><br class=""></div><div class=""><br class=""><div class=""> <div \
style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: \
after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; \
font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Best \
Regards,</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: \
12px; font-style: normal; font-variant-caps: normal; font-weight: normal; \
letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; \
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: \
0px;">Danila</div></div> </div>
<div><br class=""><blockquote type="cite" class=""><div class="">On 17 Aug 2018, at \
16:49, conquistadorjd <<a href="mailto:nginx-forum@forum.nginx.org" \
class="">nginx-forum@forum.nginx.org</a>> wrote:</div><br \
class="Apple-interchange-newline"><div class=""><div class="">I am running a \
wordpress multisite website with subdomain option. <a href="http://example.me" \
class="">example.me</a><br class="">is my main website <a \
href="https://one.example.me" class="">https://one.example.me</a>, <a \
href="https://two.example.me/two" class="">https://two.example.me/two</a> etc<br \
class="">are the network websites.<br class=""><br class="">Now I am planning to have \
a small laravel application accessible at<br class=""><a href="http://example.me" \
class="">example.me</a>. I tried using different combination but not able to figure \
this<br class="">out. Could not find any examples in search results as well.Can \
someone let<br class="">me know how can I use laravel webapp at main/root address <a \
href="https://example.me" class="">https://example.me</a><br class="">and mutilsite \
with subdomain ?<br class=""><br class="">I am new to NGINX. Here is my nginx \
code.<br class=""><br class="">map $http_host $blogid {<br class=""> \
default 0;<br class=""> include<br \
class="">/var/www/goingplacesme/wp-content/uploads/nginx-helper/map.conf;<br \
class="">}<br class=""><br class="">server {<br class=""> \
listen 80;<br class=""> \
listen [::]:80;<br class=""><br class=""> \
root /var/www/exampleme;<br class=""><br \
class=""> index index.html index.htm \
index.nginx-debian.html;<br class=""><br class=""> \
server_name <a href="http://example.me" \
class="">example.me</a> <a href="http://www.example.me" \
class="">www.example.me</a>;<br class=""><br class=""> \
location / {<br class=""> \
#try_files \
$uri $uri/ =404;<br class=""> \
try_files \
$uri /index.php$is_args$args;<br class=""> \
}<br class=""><br class=""> \
# pass the PHP scripts to FastCGI server \
listening on<br class="">127.0.0.1:9000<br class=""> \
location ~ \.php$ {<br class=""> \
include \
snippets/fastcgi-php.conf;<br class=""><br class=""> \
# \
With php7.0-cgi alone:<br class=""> \
#fastcgi_pass \
127.0.0.1:9000;<br class=""> \
# \
With php7.0-fpm:<br class=""> \
fastcgi_pass \
unix:/run/php/php7.0-fpm.sock;<br class=""> \
}<br class=""><br class=""> \
# deny access to .htaccess files, if \
Apache's document root<br class=""> # \
concurs with nginx's one<br class=""> #<br \
class=""> #location ~ /\.ht {<br class=""> \
# deny \
all;<br class=""> #}<br class=""> \
location ~ ^/files/(.*)$ {<br class=""> \
try_files \
/wp-content/blogs.dir/$blogid/$uri<br class="">/wp-includes/ms-files.php?file=$1 ;<br \
class=""> access_log off; \
log_not_found off; expires max;<br class=""> \
}<br class=""><br class=""> \
location ~* \
\.(js|css|png|jpg|jpeg|gif|ico)$ {<br class=""> \
expires \
24h;<br class=""> log_not_found \
off;<br class=""> }<br class=""><br \
class=""> location ^~ /blogs.dir {<br \
class=""> internal;<br \
class=""> alias \
/var/www/pathtoyoursite/web/wp-content/blogs.dir ;<br class=""> \
access_log \
off; log_not_found off; expires max;<br class=""> \
}<br class=""><br class=""><br class=""><br \
class=""> if (!-e $request_filename) {<br \
class=""> rewrite \
/wp-admin$ $<a href="scheme://$host$uri/" class="">scheme://$host$uri/</a> \
permanent;<br class=""> \
rewrite \
^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;<br class=""> \
rewrite \
^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;<br class=""> \
}<br class=""><br class="">}<br \
class=""><br class="">Posted at Nginx Forum: <a \
href="https://forum.nginx.org/read.php?2,280904,280904#msg-280904" \
class="">https://forum.nginx.org/read.php?2,280904,280904#msg-280904</a><br \
class=""><br class="">_______________________________________________<br \
class="">nginx mailing list<br class=""><a href="mailto:nginx@nginx.org" \
class="">nginx@nginx.org</a><br \
class="">http://mailman.nginx.org/mailman/listinfo/nginx<br \
class=""></div></div></blockquote></div><br class=""></div></body></html>
["signature.asc" (signature.asc)]
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEExx2r7yNXeYbjbgPisU8quKRjw74FAlt3GB4ACgkQsU8quKRj
w74N5Q/+Lt4Fqp3KXZv8mAOxOsSyNhxHAcArfohXjjIzweTA3X3SaocTqAx3dVJM
hwP0kusMtBX2XNtA1TZiqjoibpDpDJhkwb6djJMJ4CBXDtGAT2nIgxRdHyz9U15d
644TP7dc0/a2MZ7Z1ZigGEw/xjabuOJ+nxzezYZYlzP2+UuQFP2Qu4LvRsNHOMBh
+sw0xZDBgzPXW6qnX8y5s/ngkLj4IpudXlTbbnbwtpw7QT8TTGex9Y8TKRs5jQLc
btXsyNZ57Vil/Q04SQWPJzycC7XuqCOtlTB+sgEUmPss3cMzcNeITlaIT4KtCCmY
wKsi/xT7+KJJwV3Gzc4CY4TM8BOFQ+NGlhrrwkN7wnb1iphKo5KrJRSuKiNPia2J
3WR2Euz7XVwze6n9V68YwSkXNlQplEXSRIfHqzUrLMUlzhU8qhhizunqFtQmxLg6
FnhVgaChfoJRNgYe3Ydzsugv4vGYe1loiIn2piQdFvJftlVdsXEyOAj3FC23wWFD
B5fCfBFnD++Yt3rBhrxuT+Y8JiE7wrsH31SCVgIN6GfHFg6JHGwrT85dx+0Do/vb
OoXgSJhybQQdJkltZss4iBBITkFmmqdKcAZxCldxguZDGIZ02x4ZtPG+v/4bWr7F
HjlJOwtK6vdr9o44EcHGk7IAF94n00Dv7VtoG9DAQWQ7YH3hbGM=
=U0D/
-----END PGP SIGNATURE-----
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic