mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge branch 'master' of https://github.com/deldesir/iiab into deldesir-master
This commit is contained in:
commit
4440f81933
3 changed files with 43 additions and 4 deletions
16
roles/cups/tasks/nginx.yml
Normal file
16
roles/cups/tasks/nginx.yml
Normal 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
|
|
@ -1,2 +1,25 @@
|
||||||
ProxyPass /cups http://localhost:631
|
location ~ /print/(.*) {
|
||||||
ProxyPassReverse /cups http://localhost:631
|
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;
|
||||||
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
ServerAlias *
|
ServerAlias *
|
||||||
LogLevel warn
|
LogLevel warn
|
||||||
MaxLogSize 1m
|
MaxLogSize 1m
|
||||||
Listen {{ lan_ip }}:631
|
#Listen {{ lan_ip }}:631
|
||||||
Listen localhost:631
|
Listen 127.0.0.1:631
|
||||||
Listen /var/run/cups/cups.sock
|
Listen /var/run/cups/cups.sock
|
||||||
Browsing On
|
Browsing On
|
||||||
BrowseLocalProtocols dnssd
|
BrowseLocalProtocols dnssd
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue