4949 <pre >
5050# VueFront scripts, styles and images
5151RewriteCond %{REQUEST_URI} .*(_nuxt)
52- RewriteCond %{REQUEST_URI} !.*vuefront/_nuxt
52+ RewriteCond %{REQUEST_URI} !.*/ vuefront/_nuxt
5353RewriteRule ^([^?]*) vuefront/$1
5454
55+ # VueFront sw.js
56+ RewriteCond %{REQUEST_URI} .*(sw.js)
57+ RewriteCond %{REQUEST_URI} !.*/vuefront/sw.js
58+ RewriteRule ^([^?]*) vuefront/$1
59+
60+ # VueFront favicon.ico
61+ RewriteCond %{REQUEST_URI} .*(favicon.ico)
62+ RewriteCond %{REQUEST_URI} !.*/vuefront/favicon.ico
63+ RewriteRule ^([^?]*) vuefront/$1
64+
65+
5566# VueFront pages
5667
5768# VueFront home page
69+ RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
70+ RewriteCond %{QUERY_STRING} !.*(rest_route)
71+ RewriteCond %{DOCUMENT_ROOT}/vuefront/index.html -f
5872RewriteRule ^$ vuefront/index.html [L]
5973
74+ RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
75+ RewriteCond %{QUERY_STRING} !.*(rest_route)
76+ RewriteCond %{DOCUMENT_ROOT}/vuefront/index.html !-f
77+ RewriteRule ^$ vuefront/200.html [L]
78+
6079# VueFront page if exists html file
6180RewriteCond %{REQUEST_FILENAME} !-f
6281RewriteCond %{REQUEST_FILENAME} !-d
63- RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico)
82+ RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
83+ RewriteCond %{QUERY_STRING} !.*(rest_route)
6484RewriteCond %{DOCUMENT_ROOT}/vuefront/$1.html -f
6585RewriteRule ^([^?]*) vuefront/$1.html [L,QSA]
6686
6787# VueFront page if not exists html file
6888RewriteCond %{REQUEST_FILENAME} !-f
6989RewriteCond %{REQUEST_FILENAME} !-d
70- RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico)
90+ RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
91+ RewriteCond %{QUERY_STRING} !.*(rest_route)
7192RewriteCond %{DOCUMENT_ROOT}/vuefront/$1.html !-f
7293RewriteRule ^([^?]*) vuefront/200.html [L,QSA]</pre >
7394 </div >
@@ -88,81 +109,8 @@ RewriteRule ^([^?]*) vuefront/200.html [L,QSA]</pre>
88109 v-html =" $t('descriptionConfigureNginx')"
89110 />
90111 <pre >
91- server {
92- listen 443 ssl http2;
93- listen [::]:443 ssl http2;
94- server_name YOUR_DOMAIN; # setup your domain here
95-
96- # supply SSL certificates here
97-
98- root /OPENCART_ROOT_FOLDER_PATH/vuefront; #setup your opencart root folder path here following with /vuefront on the end. This will return the VueFront Web App by default.
99- index index.html index.php;
100-
101- location / {
102- try_files $uri $uri/ $uri.html /200.html;
103-
104- # required to return OpenCart index.php
105- location /index.php {
106- root /OPENCART_ROOT_FOLDER_PATH/; #setup your opencart root folder path
107- index index.php;
108-
109- location ~ \.php$ {
110- include snippets/fastcgi-php.conf;
111- fastcgi_pass unix:/var/run/php/php7.2-fpm-opencart.vuefront.com.sock;
112- }
113- }
114-
115- # required to return OpenCart catalog folder
116- location /catalog {
117- root /OPENCART_ROOT_FOLDER_PATH/; #setup your opencart root folder path
118- index index.php;
119-
120- location ~* \.(jpg|jpeg|gif|png|ico|pdf|ppt|bmp|rtf|svg|otf|woff|woff2|ttf)$ {
121- expires max;
122- add_header Pragma public;
123- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
124- }
125-
126- location ~* \.(js|css|txt)$ {
127- expires 3d;
128- add_header Pragma public;
129- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
130- }
131- }
132-
133- # required to return the OpenCart admin folder
134- location /admin {
135- root /OPENCART_ROOT_FOLDER_PATH/; #setup your opencart root folder path
136- index index.php;
137-
138- location ~ \.php$ {
139- include snippets/fastcgi-php.conf;
140- fastcgi_pass unix:/var/run/php/php7.2-fpm-opencart.vuefront.com.sock;
141- }
142- }
143- # required to return images
144- location /image {
145- root /OPENCART_ROOT_FOLDER_PATH/; #setup your opencart root folder path
146- index index.php;
147-
148- location ~* \.(jpg|jpeg|gif|png|ico|pdf|ppt|bmp|rtf|svg|otf|woff|woff2|ttf)$ {
149- expires max;
150- add_header Pragma public;
151- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
152- }
153-
154- location ~* \.(js|css|txt)$ {
155- expires 3d;
156- add_header Pragma public;
157- add_header Cache-Control "public, must-revalidate, proxy-revalidate";
158- }
159- }
160-
161- #You should have it already since you are running OpenCart on Nginx. But just in case, we supplied this rule below.
162- location ~ \.php$ {
163- include snippets/fastcgi-php.conf;
164- fastcgi_pass unix:/var/run/php/YOUR_PHP_FPM_SOKET.sock; #setup your php-fpm socket
165- }
112+ location ~ ^((?!image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/).)*$ {
113+ try_files /vuefront/$uri /vuefront/$uri "/vuefront${uri}index.html" /vuefront$uri.html /vuefront/200.html;
166114}</pre >
167115 </div >
168116 </div >
0 commit comments