chore: 基础镜像中添加pdf.js
This commit is contained in:
parent
e1dc73556e
commit
9cf0376c4b
@ -6,12 +6,18 @@ RUN mkdir -p /etc/nginx/servers /var/www
|
|||||||
|
|
||||||
RUN wget https://github.com/jgraph/drawio/releases/download/v24.4.10/draw.war -O /var/www/draw.war
|
RUN wget https://github.com/jgraph/drawio/releases/download/v24.4.10/draw.war -O /var/www/draw.war
|
||||||
|
|
||||||
|
RUN wget https://github.com/mozilla/pdf.js/releases/download/v4.3.136/pdfjs-4.3.136-dist.zip -O /var/www/pdfjs.zip
|
||||||
|
|
||||||
RUN unzip /var/www/draw.war -d /var/www/draw
|
RUN unzip /var/www/draw.war -d /var/www/draw
|
||||||
|
|
||||||
RUN rm -rf /var/www/draw.war /var/www/draw/META-INF /var/www/draw/WEB-INF
|
RUN unzip /var/www/pdfjs.zip -d /var/www/pdfjs
|
||||||
|
|
||||||
|
RUN rm -rf /var/www/pdfjs.zip /var/www/draw.war /var/www/draw/META-INF /var/www/draw/WEB-INF
|
||||||
|
|
||||||
RUN apt-get remove -y unzip wget && \
|
RUN apt-get remove -y unzip wget && \
|
||||||
apt-get autoremove -y && \
|
apt-get autoremove -y && \
|
||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
COPY docker/nginx-drawio/drawio.conf /etc/nginx/servers/drawio.conf
|
COPY docker/nginx-drawio/drawio.conf /etc/nginx/servers/drawio.conf
|
||||||
|
|
||||||
|
COPY docker/nginx-drawio/pdfjs.conf /etc/nginx/servers/pdfjs.conf
|
||||||
|
|||||||
5
docker/nginx-drawio/pdfjs.conf
Normal file
5
docker/nginx-drawio/pdfjs.conf
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
server {
|
||||||
|
listen 8081;
|
||||||
|
server_name localhost;
|
||||||
|
root /var/www/pdfjs;
|
||||||
|
}
|
||||||
18
nginx.conf
18
nginx.conf
@ -195,6 +195,24 @@ http {
|
|||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection $connection_upgrade;
|
proxy_set_header Connection $connection_upgrade;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /pdf.js/ {
|
||||||
|
proxy_pass http://localhost:8081/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Real-PORT $remote_port;
|
||||||
|
proxy_set_header X-Forwarded-Host $the_host//pdf.js;
|
||||||
|
proxy_set_header X-Forwarded-Proto $the_scheme;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header Scheme $scheme;
|
||||||
|
proxy_set_header Server-Protocol $server_protocol;
|
||||||
|
proxy_set_header Server-Name $server_name;
|
||||||
|
proxy_set_header Server-Addr $server_addr;
|
||||||
|
proxy_set_header Server-Port $server_port;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $connection_upgrade;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include servers/*;
|
include servers/*;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user