1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Merge pull request #499 from deldesir/master

Sync from deldesir:master
This commit is contained in:
A Holt 2021-07-11 08:21:13 -04:00 committed by GitHub
commit 06fc2d4c49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 4 deletions

View file

@ -0,0 +1,16 @@
- name: Enable http://box/print via NGINX, by installing {{ nginx_conf_dir }}/cups.conf from template
template:
src: cups.conf
dest: /etc/nginx/conf.d/cups.conf
when: cups_enabled
- name: Disable http://box/print via NGINX, by removing {{ nginx_conf_dir }}/cups.conf
file:
path: /etc/nginx/conf.d/cups.conf
state: absent
when: not cups_enabled
- name: Restart 'nginx' systemd service
systemd:
name: nginx
state: restarted

View file

@ -1,2 +1,25 @@
ProxyPass /cups http://localhost:631
ProxyPassReverse /cups http://localhost:631
location ~ /print/(.*) {
proxy_pass http://127.0.0.1:631/$1;
proxy_set_header Host '127.0.0.1';
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
sub_filter ' href="/' ' href="/print/';
sub_filter ' action="/' ' action="/print/';
sub_filter ' src="/' ' src="/print/';
sub_filter_types *;
sub_filter_once off;
}
location ~ /cups/(.*) {
proxy_pass http://127.0.0.1:631/$1;
proxy_set_header Host '127.0.0.1';
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
sub_filter ' href="/' ' href="/cups/';
sub_filter ' action="/' ' action="/cups/';
sub_filter ' src="/' ' src="/cups/';
sub_filter_types *;
sub_filter_once off;
}

View file

@ -1,8 +1,8 @@
ServerAlias *
LogLevel warn
MaxLogSize 1m
Listen {{ lan_ip }}:631
Listen localhost:631
#Listen {{ lan_ip }}:631
Listen 127.0.0.1:631
Listen /var/run/cups/cups.sock
Browsing On
BrowseLocalProtocols dnssd