Skip to content

Commit b8183b9

Browse files
committed
fix: #86ew03681 Update ImageField component to log upload link and adjust Nginx configuration for trailing slashes
- Added a console log in the ImageField component to display the upload link during file uploads. - Updated the proxy_pass directive in default.conf and default.local.conf to include a trailing slash for consistent API request handling. - Introduced a new location block in default.conf to redirect requests from /admin to /admin/ for improved routing.
1 parent b9fc0b8 commit b8183b9

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

admin_panel/components/inputs/ImageField.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ export default {
7171
let file = await this.extractImage();
7272
this.uploadPending = true;
7373
74+
console.log("Uploading file to:", fileProvider.getUploadLink());
75+
7476
// If there's an existing image, remove it first without triggering updates
7577
if (this.fileDoc != null && this.fileDoc._id) {
7678
try {

nginx/default.conf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ server {
5959

6060
# Proxy API requests to server service
6161
location /api/ {
62-
proxy_pass http://server:8081;
62+
proxy_pass http://server:8081/;
6363
proxy_http_version 1.1;
6464
proxy_set_header Host $host;
6565
proxy_set_header X-Real-IP $remote_addr;
@@ -81,6 +81,11 @@ server {
8181
proxy_request_buffering on;
8282
}
8383

84+
# Handle admin root without trailing slash
85+
location = /admin {
86+
return 301 /admin/;
87+
}
88+
8489
# Serve admin panel static files
8590
location /admin/ {
8691
alias /usr/share/nginx/html/admin/;

nginx/default.local.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ server {
3030

3131
# Proxy API requests to server service
3232
location /api/ {
33-
proxy_pass http://server:8081;
33+
proxy_pass http://server:8081/;
3434
proxy_http_version 1.1;
3535
proxy_set_header Host $host;
3636
proxy_set_header X-Real-IP $remote_addr;

0 commit comments

Comments
 (0)