Skip to content

Commit e4b97e6

Browse files
committed
fix: fix config for apache and nginx
1 parent 6b0012b commit e4b97e6

30 files changed

+58
-110
lines changed

plugin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,28 +162,28 @@ function VFA_vuefront_admin_action_turn_on() {
162162
# VueFront pages
163163
164164
# VueFront home page
165-
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
165+
RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
166166
RewriteCond %{QUERY_STRING} !.*(rest_route)
167167
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/index.html -f
168168
RewriteRule ^$ vuefront/index.html [L]
169169
170-
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
170+
RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
171171
RewriteCond %{QUERY_STRING} !.*(rest_route)
172172
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/index.html !-f
173173
RewriteRule ^$ vuefront/200.html [L]
174174
175175
# VueFront page if exists html file
176176
RewriteCond %{REQUEST_FILENAME} !-f
177177
RewriteCond %{REQUEST_FILENAME} !-d
178-
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
178+
RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
179179
RewriteCond %{QUERY_STRING} !.*(rest_route)
180180
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/$1.html -f
181181
RewriteRule ^([^?]*) vuefront/$1.html [L,QSA]
182182
183183
# VueFront page if not exists html file
184184
RewriteCond %{REQUEST_FILENAME} !-f
185185
RewriteCond %{REQUEST_FILENAME} !-d
186-
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout)
186+
RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
187187
RewriteCond %{QUERY_STRING} !.*(rest_route)
188188
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/$1.html !-f
189189
RewriteRule ^([^?]*) vuefront/200.html [L,QSA]";

view/javascript/d_pax/components/development.vue

Lines changed: 26 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,46 @@
4949
<pre>
5050
# VueFront scripts, styles and images
5151
RewriteCond %{REQUEST_URI} .*(_nuxt)
52-
RewriteCond %{REQUEST_URI} !.*vuefront/_nuxt
52+
RewriteCond %{REQUEST_URI} !.*/vuefront/_nuxt
5353
RewriteRule ^([^?]*) 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
5872
RewriteRule ^$ 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
6180
RewriteCond %{REQUEST_FILENAME} !-f
6281
RewriteCond %{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)
6484
RewriteCond %{DOCUMENT_ROOT}/vuefront/$1.html -f
6585
RewriteRule ^([^?]*) vuefront/$1.html [L,QSA]
6686

6787
# VueFront page if not exists html file
6888
RewriteCond %{REQUEST_FILENAME} !-f
6989
RewriteCond %{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)
7192
RewriteCond %{DOCUMENT_ROOT}/vuefront/$1.html !-f
7293
RewriteRule ^([^?]*) 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>

view/javascript/d_vuefront/0.e6da08e4c2cba367991f.bundle.js renamed to view/javascript/d_vuefront/0.c52553d8b74542c19fe6.bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)