Skip to content

Commit feeaa6c

Browse files
committed
fix: fix config for apache and nginx
1 parent ad8ecd0 commit feeaa6c

32 files changed

+60
-112
lines changed

controllers/admin/AdminVuefrontAjaxController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,28 @@ public function ajaxProcessVfTurnOn() {
9696
# VueFront pages
9797
9898
# VueFront home page
99-
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout|jpg)
99+
RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
100100
RewriteCond %{QUERY_STRING} !.*(rest_route)
101101
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/index.html -f
102102
RewriteRule ^$ vuefront/index.html [L]
103103
104-
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout|jpg)
104+
RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
105105
RewriteCond %{QUERY_STRING} !.*(rest_route)
106106
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/index.html !-f
107107
RewriteRule ^$ vuefront/200.html [L]
108108
109109
# VueFront page if exists html file
110110
RewriteCond %{REQUEST_FILENAME} !-f
111111
RewriteCond %{REQUEST_FILENAME} !-d
112-
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout|jpg)
112+
RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
113113
RewriteCond %{QUERY_STRING} !.*(rest_route)
114114
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/$1.html -f
115115
RewriteRule ^([^?]*) vuefront/$1.html [L,QSA]
116116
117117
# VueFront page if not exists html file
118118
RewriteCond %{REQUEST_FILENAME} !-f
119119
RewriteCond %{REQUEST_FILENAME} !-d
120-
RewriteCond %{REQUEST_URI} !.*(images|index.php|.html|admin|.js|.css|.png|.jpeg|.ico|wp-json|wp-admin|checkout|jpg)
120+
RewriteCond %{REQUEST_URI} !.*(image|.php|admin|catalog|\/img\/.*\/|wp-json|wp-admin|wp-content|checkout|rest|static|order|themes\/|modules\/|js\/|\/vuefront\/)
121121
RewriteCond %{QUERY_STRING} !.*(rest_route)
122122
RewriteCond %{DOCUMENT_ROOT}".$document_path."vuefront/$1.html !-f
123123
RewriteRule ^([^?]*) vuefront/200.html [L,QSA]";

views/js/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>

views/js/d_vuefront/0.adca5abcd215dbda4f91.bundle.js renamed to views/js/d_vuefront/0.4ccd0cd5ab10b7705f3f.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)