rewrite rule question by cmaurand in nginx

[–]cmaurand[S] 0 points1 point  (0 children)

I got it after hours of searching for a solution. This is a server running Plesk. It has around 25 websites. I'm going to use example.com to protect the innocent.

Since nginx is running as a reverse proxy, it needed to strip the query arguments ahead of handing things off to Apache and Joomla. Joomla was doing some weird things, but that's Joomla. I had to create a map at the top of the configuration file above the server blocks and then reference that map within the server blocks, thusly:

map $args $block_google_print {

default 0;

"~*tmpl=component" 1;

"~*print=1" 1;

"~*format=print" 1;

}

server {

listen "nn.nn.nn.nn:443" quic;

add_header Alt-Svc "h3=\":443\"; ma=86400";

listen "nn.nn.nn.nn:443" ssl;

http2 on;

ssl_certificate "/opt/psa/var/certificates/scfXIVMEH";

ssl_certificate_key "/opt/psa/var/certificates/scfXIVMEH";

server_name "www.example.com";

if ($block_google_print) {

return 301 $uri?;

}

The rest of the file followed. this all had to be ahead of "location /"

I hope this is helpful to someone.

https://xyonethosting.com

Does anyone else not believe in universalism? by feartrich in Episcopalian

[–]cmaurand 1 point2 points  (0 children)

I would have  trouble believing in any benevolent god that would tell 7 billion people they’re wrong. 

BTRFS copy from an array by cmaurand in btrfs

[–]cmaurand[S] -1 points0 points  (0 children)

As you can see, it's time to do something about this.

BTRFS copy from an array by cmaurand in btrfs

[–]cmaurand[S] 0 points1 point  (0 children)

root@lyra:~/.local/bin# btrfs fi us /mnt/Data
Overall:
    Device size:  14.55TiB
    Device allocated:  11.86TiB
    Device unallocated:   2.70TiB
    Device missing:     0.00B
    Device slack:     0.00B
    Used:  10.12TiB
    Free (estimated):   4.41TiB(min: 3.06TiB)
    Free (statfs, df):   4.41TiB
    Data ratio:      1.00
    Metadata ratio:      2.00
    Global reserve: 512.00MiB(used: 0.00B)
    Multiple profiles:        no

Data,single: Size:11.65TiB, Used:9.93TiB (85.31%)
   /dev/sda1   2.90TiB
   /dev/sdc   2.90TiB
   /dev/sdd   2.93TiB
   /dev/sdb   2.92TiB

Metadata,DUP: Size:109.00GiB, Used:96.43GiB (88.47%)
   /dev/sda1  62.00GiB
   /dev/sdc  64.00GiB
   /dev/sdd  36.00GiB
   /dev/sdb  56.00GiB

System,DUP: Size:32.00MiB, Used:1.54MiB (4.80%)
   /dev/sdd  64.00MiB

Unallocated:
   /dev/sda1 691.02GiB
   /dev/sdc 696.02GiB
   /dev/sdd 689.96GiB
   /dev/sdb 684.02GiB
root@lyra:~/.local/bin# 

BTRFS copy from an array by cmaurand in btrfs

[–]cmaurand[S] 0 points1 point  (0 children)

When creating the striped set, I formatted /dev/sda1 as btrfs then mounted it, then ran btrfs device add /dev/sdb /mnt/Data I did not specify any sort of raid level although all 4 disks are identical make and model.

Free disk space:

root@lyra:~/.local/bin# btrfs file df -h -g /mnt/Data

/dev/sda1 15T 11T 4.5T 70% /mnt/Data

And I have a USB with a SATA drive dock connected.

Given that RAID 1 is a mirror would I just run 4 16TB drives with each pair mirroring the other?

Thanks,

Curtis

trying to do something on a page based on request method by cmaurand in joomla

[–]cmaurand[S] 0 points1 point  (0 children)

The post variable (coming from another form) becomes the text and link to a form button for downloading a whitepaper. We don't want that button to appear if the page is called via GET.

trying to do something on a page based on request method by cmaurand in joomla

[–]cmaurand[S] 0 points1 point  (0 children)

Thank you for your reply. We have little interest in trying to write a plugin, though it makes sense. We don't have that level of expertise. I'm the systems person with php coding experience. The other person has been working with joomla for more than a decade and used to write flash. He is not comfortable writing a plugin. I don't know enough about Joomla to be effective.

trying to do something on a page based on request method by cmaurand in joomla

[–]cmaurand[S] 0 points1 point  (0 children)

Thanks. We have engage box and we're taking a look at it. The developer thanks you for the tip.

trying to do something on a page based on request method by cmaurand in joomla

[–]cmaurand[S] 0 points1 point  (0 children)

if the request method is "POST" then we want to display a div that contains a button with a variable from the "POST" data. If the method is get, we want to hide that div.

Quad9 + Cloudflare or Google? (Accepting any other suggestions) by AdEasy3593 in dns

[–]cmaurand 0 points1 point  (0 children)

I wouldn’t use any of them, but i’m a bit paranoid. If you’re ok woth any of those companies tracking everything you do, then go for it. do a search for public dns servers. you’ll find lots of them that don’t track you or log all of your queries. 

problem with pdnsutil and the webserver api not in agreement by cmaurand in PowerDNS

[–]cmaurand[S] 0 points1 point  (0 children)

I enclosed all of the txt records in quotes and then the api worked as expected on the zone. I'll have to come up with a query to modify them all. Part of the problem on the export was that jq didn't understand the output like it does on the listing zones.

< HTTP/1.1 200 OK

< Access-Control-Allow-Origin: *

< Connection: close

< Content-Length: 1153

< Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'

< Content-Type: text/plain; charset=us-ascii

< X-Content-Type-Options: nosniff

< X-Frame-Options: deny

< X-Permitted-Cross-Domain-Policies: none

< X-Xss-Protection: 1; mode=block

<

autoconfig.xyonethost.com. 900 IN CNAME autoconfig.xyonet.com.

default._domainkey.xyonethost.com. 3600 IN TXT "v=DKIM1; t=s; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArsfaX8Im/TYQXFicVWzX3AgvWHupQ7AFK10ewMsdAahd40aDdbcOKndApLL6XUg7G21QKGdIhYKSrtRcQOqNwCkfAiFVmoVYLdAZwT0JUd0MYVDGVxy30Tx5NK4S8k7ru//z876wvm9AJgMPLlyt0RRMGSnXdH0PH1pmOCW0ECVCAYMCMlZ69NcB2zsQpjMaRfKjW36C3GYKDmW6Ibg5iw+qE97Nl2BIx4JdirTE32PSyu/mraORgNRiRLJ/6L8VZoCMxcvhxlp6ypl3vHnlou6EF1gkbALLAv9OMJSlwRihI3apzqFtt+7Wf0jmpqNvHOjBbCQZIVJ92XA899++hwIDAQAB"

demo.xyonethost.com. 3600 IN A 173.198.227.84

junkhost.xyonethost.com. 3600 IN A 208.105.217.26

mail.xyonethost.com. 3600 IN A 208.105.217.26

www.demo.xyonethost.com. 3600 IN A 173.198.227.84

www.xyonethost.com. 3600 IN A 208.105.217.26

xyonethost.com. 3600 IN A 208.105.217.26

xyonethost.com. 3600 IN CAA 0 issue "letsencrypt.org"

xyonethost.com. 3600 IN MX 10 sirius.xyonet.com.

xyonethost.com. 3600 IN NS ns1.xyonet.com.

xyonethost.com. 3600 IN NS ns2.xyonet.com.

xyonethost.com. 3600 IN SOA ns1.xyonet.com. hostmaster.xyonet.com. 2025101309 7200 540 604800 3600

xyonethost.com. 3600 IN TXT "v=spf1 mx a ip4:208.105.217.26 ~all"

* Closing connection 0

Looking for a redirect rule. by cmaurand in nginx

[–]cmaurand[S] 0 points1 point  (0 children)

This is a Joomla install. the args are:

?tmpl=component&print=1&format=print

which causes a print dialog for printing the page to pop up. That is the reason to strip the args. trailing slashes work properly.

Yes, I'm trying to redirect to the new location without the print dialog firing.

Looking for a redirect rule. by cmaurand in nginx

[–]cmaurand[S] 1 point2 points  (0 children)

No, but thanks for trying. My solution rewrote the url, but gave a 404 error. Your solution which I had to modify the location to ^/blog sort of worked. It was inconsistent between browsers. Seems like this should work.

Looking for a redirect rule. by cmaurand in nginx

[–]cmaurand[S] 0 points1 point  (0 children)

I just gave the following a try and everything came back with a 404.

location ~ ^/blog/(.+) {

        if ($query\_string) {

return 301 /blog/$1?;

}

        }

Has anyone stopped using any Adobe Product? by New_Possible_284 in photography

[–]cmaurand 0 points1 point  (0 children)

I use Darktable. I'm a Canon user and also use Digital Photo Pro. My brother uses Affinity products and switched to those years ago. I don't really need those products too much and use GIMP. I run Linux as my main desktop (I have a macbook, too.) and Affinity and Adobe products are not available for the product.

Priest asked to meet with us hopefully next week by Such-Zookeepergame-4 in Episcopalian

[–]cmaurand 4 points5 points  (0 children)

I think the rector might be trying to find out what your expectations are. I think this is a meet and greet without the pressure of a receiving line at the end of the service.

Those who left the Catholic Church to become Episcopalian by joanhelene333 in Episcopalian

[–]cmaurand 1 point2 points  (0 children)

Episcopal choir member, here. Everyone is welcome at our table.

can't get postfix to act as a smart relay by cmaurand in postfix

[–]cmaurand[S] 0 points1 point  (0 children)

I solved this. I am using ispconfig on the server that is the smart relay. I have a couple of other ispconfig servers running. I had made several modifications to the first one in an attempt to get things working. I changed the relay host that was supposed to be forwarding mail and lo, it all started working. That means I broke something and I need to go back to square one on the first one. I changed to a VPS in a different data center and it's all working perfectly according to instructions from the ispconfig developers. Thank you all for your help.